Method: Puppet::Type#parent

Defined in:
lib/puppet/type.rb

#parentPuppet::Type?

Returns the parent of this in the catalog. In case of an erroneous catalog where multiple parents have been produced, the first found (non deterministic) parent is returned.



2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
# File 'lib/puppet/type.rb', line 2509

def parent
  return nil unless catalog
  return @parent if @parent

  parents = catalog.adjacent(self, :direction => :in)
  @parent = if parents
              parents.shift
            else
              nil
            end
end