Sha256: 4752ec86d9051fe5fa6926cc8dff0cda2d43e96462c09bdee86ae0dc344cbbc7

Contents?: true

Size: 943 Bytes

Versions: 12

Compression:

Stored size: 943 Bytes

Contents

require 'deep_merge/core'

module DeepMerge
  module RailsCompat
    # ko_hash_merge! will merge and knockout elements prefixed with DEFAULT_FIELD_KNOCKOUT_PREFIX
    def ko_deeper_merge!(source, options = {})
      default_opts = {:knockout_prefix => "--", :preserve_unmergeables => false}
      DeepMerge::deep_merge!(source, self, default_opts.merge(options))
    end

    # deep_merge! will merge and overwrite any unmergeables in destination hash
    def deeper_merge!(source, options = {})
      default_opts = {:preserve_unmergeables => false}
      DeepMerge::deep_merge!(source, self, default_opts.merge(options))
    end

    # deep_merge will merge and skip any unmergeables in destination hash
    def deeper_merge(source, options = {})
      default_opts = {:preserve_unmergeables => true}
      DeepMerge::deep_merge!(source, self, default_opts.merge(options))
    end
  end
end

class Hash
  include ::DeepMerge::RailsCompat
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
oats-0.1.4 lib/deep_merge/rails_compat.rb
oats-0.1.1 lib/deep_merge/rails_compat.rb
oats-0.1.0 lib/deep_merge/rails_compat.rb
oats-0.0.9 lib/deep_merge/rails_compat.rb
oats-0.0.8 lib/deep_merge/rails_compat.rb
oats-0.0.7 lib/deep_merge/rails_compat.rb
oats-0.0.6 lib/deep_merge/rails_compat.rb
oats-0.0.5 lib/deep_merge/rails_compat.rb
oats-0.0.4 lib/deep_merge/rails_compat.rb
oats-0.0.3 lib/deep_merge/rails_compat.rb
oats-0.0.2 lib/deep_merge/rails_compat.rb
oats-0.0.1 lib/deep_merge/rails_compat.rb