class Puppet::Pops::Lookup::ExplainLocation
Public Class Methods
new(parent, location)
click to toggle source
Calls superclass method
Puppet::Pops::Lookup::ExplainTreeNode::new
# File lib/puppet/pops/lookup/explainer.rb 372 def initialize(parent, location) 373 super(parent) 374 @location = location 375 end
Public Instance Methods
dump_on(io, indent, first_indent)
click to toggle source
# File lib/puppet/pops/lookup/explainer.rb 377 def dump_on(io, indent, first_indent) 378 location = @location.location 379 type_name = type == :path ? 'Path' : 'URI' 380 io << indent << type_name << ' "' << location.to_s << "\"\n" 381 indent = increase_indent(indent) 382 io << indent << 'Original ' << type_name.downcase << ': "' << @location.original_location << "\"\n" 383 branches.each {|b| b.dump_on(io, indent, indent)} 384 io << indent << type_name << " not found\n" if @event == :location_not_found 385 dump_outcome(io, indent) 386 end
to_hash()
click to toggle source
Calls superclass method
Puppet::Pops::Lookup::ExplainTreeNode#to_hash
# File lib/puppet/pops/lookup/explainer.rb 388 def to_hash 389 hash = super 390 location = @location.location 391 if type == :path 392 hash[:original_path] = @location.original_location 393 hash[:path] = location.to_s 394 else 395 hash[:original_uri] = @location.original_location 396 hash[:uri] = location.to_s 397 end 398 hash 399 end
type()
click to toggle source
# File lib/puppet/pops/lookup/explainer.rb 401 def type 402 @location.location.is_a?(Pathname) ? :path : :uri 403 end