These are chat archives for dry-rb/chat

Jun 2017
Andrew Kozin
Jun 10 2017 20:52
Hi! @flash-gordon @kwando what d'you mean when mention with? Is that a sort of with_options in AR::Validations ?
Nikita Shilnikov
Jun 10 2017 21:11
@nepalez in some dry/rom gems we established a convention of initializing a copy of an object that doesn't have a mutable state. Very similar to how Hash#merge works, for example, relation.with(name: gives you a full copy of the relation object with changed :name. We'd be happy to see it in dry-initializer OOTB, wdyt?
Can be as simple as def with(new_options)*params, options.merge(new_options))