Class: Puppet::Pops::Lookup::ExplainPath

Inherits:
ExplainTreeNode show all
Defined in:
lib/puppet/pops/lookup/explainer.rb

Instance Attribute Summary

Attributes inherited from ExplainTreeNode

#event, #key, #parent, #value

Instance Method Summary collapse

Methods inherited from ExplainTreeNode

#dump_outcome, #dump_value, #found, #found_in_defaults, #found_in_overrides, #increase_indent, #module_not_found, #not_found, #path_not_found, #result

Methods inherited from ExplainNode

#branches, #to_s

Constructor Details

#initialize(parent, path) ⇒ ExplainPath

Returns a new instance of ExplainPath.



292
293
294
295
# File 'lib/puppet/pops/lookup/explainer.rb', line 292

def initialize(parent, path)
  super(parent)
  @path = path
end

Instance Method Details

#dump_on(io, indent, first_indent) ⇒ Object



297
298
299
300
301
302
303
304
# File 'lib/puppet/pops/lookup/explainer.rb', line 297

def dump_on(io, indent, first_indent)
  io << indent << 'Path "' << @path.path << "\"\n"
  indent = increase_indent(indent)
  io << indent << 'Original path: ' << @path.original_path << "\n"
  branches.each {|b| b.dump_on(io, indent, indent)}
  io << indent << "Path not found\n" if @event == :path_not_found
  dump_outcome(io, indent)
end

#to_hashObject



306
307
308
309
310
311
# File 'lib/puppet/pops/lookup/explainer.rb', line 306

def to_hash
  hash = super
  hash[:original_path] = @path.original_path
  hash[:path] = @path.path.to_s
  hash
end

#typeObject



313
314
315
# File 'lib/puppet/pops/lookup/explainer.rb', line 313

def type
  :path
end