lib/convenient_service/support/copyable.rb in convenient_service-0.6.0 vs lib/convenient_service/support/copyable.rb in convenient_service-0.7.0
- old
+ new
@@ -18,11 +18,15 @@
# @internal
# NOTE: Inline logic instead of private methods is used intentionally in order to NOT pollute the public interface.
# NOTE: This method is NOT likely to be ever changed, that is why inline logic is preferred over command classes in this particular case.
#
def copy(overrides: {})
- overrides[:args] ||= {}
- overrides[:kwargs] ||= {}
+ defaults = {args: {}, kwargs: {}}
+
+ ##
+ # IMPORTANT: Do not mutate `overrides`.
+ #
+ overrides = defaults.merge(overrides)
##
# TODO: Refactor runtime `respond_to?`. Investigate before refactoring.
#
args =