Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Settings#replace to support wholesale replacement of settings in a configurable object #109

Open
timriley opened this issue Apr 19, 2021 · 0 comments · May be fixed by #117
Open

Add Settings#replace to support wholesale replacement of settings in a configurable object #109

timriley opened this issue Apr 19, 2021 · 0 comments · May be fixed by #117

Comments

@timriley
Copy link
Member

This would better support the use case in dry-rb/dry-system#162 (see dry-rb/dry-system#162 (comment) for specific notes), in which all the settings from one class are "imported" into another for use there too.

Currently, this is done like so:

AnotherConfigurableThing._settings.each do |setting|
  _settings << setting.dup
end

But it would be nicer to do it like this:

_settings.replace(AnotherConfigurableThing._settings.dup)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant