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
activesupport-2.1.0 lib/active_support/option_merger.rb
activesupport-2.0.5 lib/active_support/option_merger.rb
activesupport-2.0.4 lib/active_support/option_merger.rb
activesupport-2.0.2 lib/active_support/option_merger.rb
activesupport-2.1.1 lib/active_support/option_merger.rb
activesupport-2.1.2 lib/active_support/option_merger.rb
antfarm-0.3.0 rails/vendor/rails/activesupport/lib/active_support/option_merger.rb
antfarm-0.4.0 rails/vendor/rails/activesupport/lib/active_support/option_merger.rb
radiant-0.6.5.1 vendor/rails/activesupport/lib/active_support/option_merger.rb
radiant-0.6.5 vendor/rails/activesupport/lib/active_support/option_merger.rb
radiant-0.6.7 vendor/rails/activesupport/lib/active_support/option_merger.rb
radiant-0.6.6 vendor/rails/activesupport/lib/active_support/option_merger.rb
radiant-0.6.8 vendor/rails/activesupport/lib/active_support/option_merger.rb
radiant-0.6.9 vendor/rails/activesupport/lib/active_support/option_merger.rb
radiant-0.7.0 vendor/rails/activesupport/lib/active_support/option_merger.rb
radiant-0.7.1 vendor/rails/activesupport/lib/active_support/option_merger.rb
spree-0.0.9 vendor/rails/activesupport/lib/active_support/option_merger.rb
spree-0.2.0 vendor/rails/activesupport/lib/active_support/option_merger.rb
swivel-0.0.149 vendor/activesupport-2.0.2-/lib/active_support/option_merger.rb
swivel-0.0.150 vendor/activesupport-2.0.2-/lib/active_support/option_merger.rb