Module: Attrify::VariantConfig::MergeableAttributes

Included in:
Attrify::VariantConfig
Defined in:
lib/attrify/variant_config.rb

Instance Method Summary collapse

Instance Method Details

#<<(other) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/attrify/variant_config.rb', line 4

def <<(other)
  merge!(other) do |key, old_val, new_val|
    if old_val.is_a?(Hash) && new_val.is_a?(Hash)
      old_val.merge(new_val)
    else
      new_val
    end
  end
end