Sha256: c5937e2c413ed6be7f1d93feb338aa217cfdf795c0e73e766c9db286a53b3169

Contents?: true

Size: 788 Bytes

Versions: 49

Compression:

Stored size: 788 Bytes

Contents

# dependent on deep_merge and deep_copy

module ActiveTools
  module CoreExtension
    
    module MergeHashup
      module HashExtension
        # Merge hashup sequence.
        #
        # === Example:
        #
        #   params = {"controller"=>"comments", "action"=>"show", "id"=>34, "article_id"=>3, "page"=>{"article"=>2}}
        #   
        #   params.merge_hashup(:page, :article, 34)
        #   # => {:controller => "comments", :action => "show", :id => 34, :article_id => 3, :page => {:article => 2, :comment => 34}}
        #
        def merge_hashup(*args)
          deep_merge(args.hashup)
        end
        
        def merge_hashup!(*args)
          deep_merge!(args.hashup)
        end
        
      end
      ::Hash.send(:include, HashExtension)
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
active_tools-0.2.5 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.2.4 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.2.3 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.2.2 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.2.1 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.2.0 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.1.4 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.1.3 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.1.2 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.1.1 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.1.0 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.0.52 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.0.51 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.0.50 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.0.42 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.0.41 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.0.40 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.0.39 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.0.38 lib/active_tools/core_extension/merge_hashup.rb
active_tools-0.0.37 lib/active_tools/core_extension/merge_hashup.rb