#ruby - 22 April 2019
« Back 1 day Forward 1 day »
[13:18:37] dionysus69: so I had to do weird hack to achieve passing hash into method args and then converting back to hash
[14:34:05] adam12: dionysus69: Hard to say without looking at something reproducable since those 2 lines don't look directly connected?
[15:07:53] old_relik: this service is called via a sidekiq job, and to avoid creating multiple jobs for multiple types, I dispatch methods on types
[15:09:04] adam12: old_relik: Seems like a violation of SRP, depending on what those methods will actually do.
[15:10:28] adam12: old_relik_: In that case I'd probably reach for regular composition techniques and keep the classes separate.
[15:11:26] old_relik_: adam12: so I think the methods are pretty related to each other and all belong to the service
[15:12:23] old_relik_: and that would then involve creating job classes for each of these method dispatches basically
[15:13:09] old_relik_: Which would then just end up doing ThingService.new().thing_1, ThingService.new().thing_2 etc.
[15:14:49] adam12: old_relik_: Too hard to presume with vague terms. I'd just use your instinct and see what feels right.
[15:15:45] old_relik_: how does one simplify the problem enough to not overburden with context without losing context...
[22:09:56] ZummiG777: Hello all! In a complex codebase I'm finding that, a variable fully of YAML settings 'DEFAULT_SETTINGS' is getting modified. I'd like to find a way to identify whose code is modifying that variable and a way to totally make the value immutable in a Python-language way.