module PoiseDerived::CoreExt::DeepMerge

Monkey-patch deep merge to carry over LazyAttribute on override. This means that if a lazy is set in a cookbook and then that attribute is overridden in a role or another cookbook, the override value gets wrapped in a LazyAttribute too so it will act as a template string. There is no way to put a block in JSON data so that would have to be explicit.

@since 1.0.0 @api private

Public Instance Methods

deep_merge!(source, dest) click to toggle source
Calls superclass method
# File lib/poise_derived/core_ext/deep_merge.rb, line 33
def deep_merge!(source, dest)
  if source.is_a?(PoiseDerived::LazyAttribute) && dest.is_a?(String)
    source._override(dest)
  else
    super
  end
end
hash_only_merge!(merge_onto, merge_with) click to toggle source
Calls superclass method
# File lib/poise_derived/core_ext/deep_merge.rb, line 41
def hash_only_merge!(merge_onto, merge_with)
  if merge_onto.is_a?(PoiseDerived::LazyAttribute) && merge_with.is_a?(String)
    merge_onto._override(merge_with)
  else
    super
  end
end