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.



344
345
346
347
# File 'lib/puppet/pops/lookup/explainer.rb', line 344

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

Instance Method Details

#dump_on(io, indent, first_indent) ⇒ Object



349
350
351
352
353
354
355
356
# File 'lib/puppet/pops/lookup/explainer.rb', line 349

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



358
359
360
361
362
363
# File 'lib/puppet/pops/lookup/explainer.rb', line 358

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

#typeObject



365
366
367
# File 'lib/puppet/pops/lookup/explainer.rb', line 365

def type
  :path
end