2 class OptionMerger #:nodoc:
3 instance_methods.each do |method|
4 undef_method(method) if method !~ /^(__|instance_eval|class|object_id)/
7 def initialize(context, options)
8 @context, @options = context, options
12 def method_missing(method, *arguments, &block)
13 merge_argument_options! arguments
14 @context.send!(method, *arguments, &block)
17 def merge_argument_options!(arguments)
18 arguments << if arguments.last.respond_to? :to_hash
19 @options.merge(arguments.pop)