Class: Puppet::Pops::Lookup::ExplainDataProvider

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, provider) ⇒ ExplainDataProvider

Returns a new instance of ExplainDataProvider.



318
319
320
321
# File 'lib/puppet/pops/lookup/explainer.rb', line 318

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

Instance Method Details

#dump_on(io, indent, first_indent) ⇒ Object



323
324
325
326
327
328
329
# File 'lib/puppet/pops/lookup/explainer.rb', line 323

def dump_on(io, indent, first_indent)
  io << first_indent << 'Data Provider "' << @provider.name << "\"\n"
  indent = increase_indent(indent)
  io << indent << 'ConfigurationPath "' << @provider.config_path << "\"\n" if @provider.respond_to?(:config_path)
  branches.each {|b| b.dump_on(io, indent, indent)}
  dump_outcome(io, indent)
end

#to_hashObject



331
332
333
334
335
336
# File 'lib/puppet/pops/lookup/explainer.rb', line 331

def to_hash
  hash = super
  hash[:name] = @provider.name
  hash[:configuration_path] = @provider.config_path.to_s if @provider.respond_to?(:config_path)
  hash
end

#typeObject



338
339
340
# File 'lib/puppet/pops/lookup/explainer.rb', line 338

def type
  :data_provider
end