Sha256: ea21ff213d764a7fae524df31fe3a3dfd6557e60c8c305ca8a5dd1b5c3e3db5b

Contents?: true

Size: 648 Bytes

Versions: 46

Compression:

Stored size: 648 Bytes

Contents

module ActiveSupport
  class OptionMerger #:nodoc:
    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)
      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

Version data entries

46 entries across 46 versions & 9 rubygems

Version Path
swivel-0.0.160 vendor/activesupport-2.0.2-/lib/active_support/option_merger.rb
swivel-0.0.175 vendor/activesupport-2.0.2-/lib/active_support/option_merger.rb
swivel-0.0.155 vendor/activesupport-2.0.2-/lib/active_support/option_merger.rb
swivel-0.0.157 vendor/activesupport-2.0.2-/lib/active_support/option_merger.rb
swivel-0.0.156 vendor/activesupport-2.0.2-/lib/active_support/option_merger.rb
swivel-0.0.152 vendor/activesupport-2.0.2-/lib/active_support/option_merger.rb