aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/option_merger.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/option_merger.rb')
-rw-r--r--activesupport/lib/active_support/option_merger.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/option_merger.rb b/activesupport/lib/active_support/option_merger.rb
index 29119d0dca..1a4ff9db9a 100644
--- a/activesupport/lib/active_support/option_merger.rb
+++ b/activesupport/lib/active_support/option_merger.rb
@@ -1,25 +1,25 @@
module ActiveSupport
class OptionMerger #:nodoc:
- instance_methods.each do |method|
+ instance_methods.each do |method|
undef_method(method) if method !~ /^(__|instance_eval|class|object_id)/
end
-
+
def initialize(context, options)
@context, @options = context, options
end
-
+
private
def method_missing(method, *arguments, &block)
merge_argument_options! arguments
- @context.send(method, *arguments, &block)
+ @context.send!(method, *arguments, &block)
end
-
+
def merge_argument_options!(arguments)
arguments << if arguments.last.respond_to? :to_hash
@options.merge(arguments.pop)
else
@options.dup
- end
+ end
end
end
end