Sha256: aac4e13795172b566937750c70f12cbc3dd0c1974ee22b65e31c9bc2e0e7609a
Contents?: true
Size: 641 Bytes
Versions: 16
Compression:
Stored size: 641 Bytes
Contents
require 'natives/catalog/validator' module Natives class Catalog class Merger def initialize(opts={}) @validator = opts.fetch(:validator, Validator.new) end def merge_catalog!(master_hash, hash_to_merge) @validator.ensure_valid_catalog_groups(master_hash) @validator.ensure_valid_catalog_groups(hash_to_merge) hash_to_merge.each do |group_name, entries| if master_hash.key? group_name master_hash[group_name].merge! entries else master_hash[group_name] = entries end end master_hash end end end end
Version data entries
16 entries across 16 versions & 2 rubygems