Class: Natives::Catalog::Merger
- Inherits:
-
Object
- Object
- Natives::Catalog::Merger
- Defined in:
- lib/natives/catalog/merger.rb
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Merger
constructor
A new instance of Merger.
- #merge_catalog!(master_hash, hash_to_merge) ⇒ Object
Constructor Details
Instance Method Details
#merge_catalog!(master_hash, hash_to_merge) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/natives/catalog/merger.rb', line 10 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 |