class Puppet::Pops::Lookup::ExplainLocation

Public Class Methods

new(parent, location) click to toggle source
    # File lib/puppet/pops/lookup/explainer.rb
371 def initialize(parent, location)
372   super(parent)
373   @location = location
374 end

Public Instance Methods

dump_on(io, indent, first_indent) click to toggle source
    # File lib/puppet/pops/lookup/explainer.rb
376 def dump_on(io, indent, first_indent)
377   location = @location.location
378   type_name = type == :path ? 'Path' : 'URI'
379   io << indent << type_name << ' "' << location.to_s << "\"\n"
380   indent = increase_indent(indent)
381   io << indent << 'Original ' << type_name.downcase << ': "' << @location.original_location << "\"\n"
382   branches.each {|b| b.dump_on(io, indent, indent)}
383   io << indent << type_name << " not found\n" if @event == :location_not_found
384   dump_outcome(io, indent)
385 end
to_hash() click to toggle source
    # File lib/puppet/pops/lookup/explainer.rb
387 def to_hash
388   hash = super
389   location = @location.location
390   if type == :path
391     hash[:original_path] = @location.original_location
392     hash[:path] = location.to_s
393   else
394     hash[:original_uri] = @location.original_location
395     hash[:uri] = location.to_s
396   end
397   hash
398 end
type() click to toggle source
    # File lib/puppet/pops/lookup/explainer.rb
400 def type
401   @location.location.is_a?(Pathname) ? :path : :uri
402 end