diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module/delegation.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/delegation.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb index 13f3894e6c..46c84eb509 100644 --- a/activesupport/lib/active_support/core_ext/module/delegation.rb +++ b/activesupport/lib/active_support/core_ext/module/delegation.rb @@ -1,5 +1,6 @@ +# frozen_string_literal: true require "set" -require "active_support/core_ext/regexp" +require_relative "../regexp" class Module # Error generated by +delegate+ when a method is called on +nil+ and +allow_nil+ @@ -174,7 +175,7 @@ class Module to = to.to_s to = "self.#{to}" if DELEGATION_RESERVED_METHOD_NAMES.include?(to) - methods.each do |method| + methods.map do |method| # Attribute writer methods only accept one argument. Makes sure []= # methods still accept two arguments. definition = /[^\]]=$/.match?(method) ? "arg" : "*args, &block" |