Method: Puppet::Pops::Lookup::ExplainMerge#dump_on

Defined in:
lib/puppet/pops/lookup/explainer.rb

#dump_on(io, indent, first_indent) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/puppet/pops/lookup/explainer.rb', line 268

def dump_on(io, indent, first_indent)
  return if branches.size == 0

  # It's pointless to report a merge where there's only one branch
  return branches[0].dump_on(io, indent, first_indent) if branches.size == 1

  io << first_indent << 'Merge strategy ' << @merge.class.key.to_s << "\n"
  indent = increase_indent(indent)
  options = options_wo_strategy
  unless options.nil?
    io << indent << 'Options: '
    dump_value(io, indent, options)
    io << "\n"
  end
  branches.each {|b| b.dump_on(io, indent, indent)}
  if @event == :result
    io << indent << 'Merged result: '
    dump_value(io, indent, @value)
    io << "\n"
  end
end