summaryrefslogtreecommitdiff
path: root/lib/forwardable.rb
diff options
context:
space:
mode:
authorJeremy Evans <[email protected]>2019-09-07 12:41:16 -0700
committerHiroshi SHIBATA <[email protected]>2019-11-30 15:53:42 +0900
commit9fa0166a580e72adf02562b7d60672c6c362d4b7 ()
treed4a5658bd122a3c48633f2dad7f4f11241b5a828 /lib/forwardable.rb
parentaf4b3f16ceed36f8b18856120940c9de6e6a0eee (diff)
[ruby/forwardable] Fix keyword argument separation warnings on Ruby 2.7+
Do so in a way that is also compatible with previous versions. https://.com/ruby/forwardable/commit/b2dd340988
-rw-r--r--lib/forwardable.rb5
1 files changed, 4 insertions, 1 deletions
@@ -183,7 +183,9 @@ module Forwardable
gen = Forwardable._delegator_method(self, accessor, method, ali)
# If it's not a class or module, it's an instance
- (Module === self ? self : singleton_class).module_eval(&gen)
end
alias delegate instance_delegate
@@ -301,6 +303,7 @@ module SingleForwardable
gen = Forwardable._delegator_method(self, accessor, method, ali)
instance_eval(&gen)
end
alias delegate single_delegate