class Puppet::Pops::Model::HostClassDefinition

Attributes

parent_class[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
2520 def self._pcore_type
2521   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::HostClassDefinition', {
2522     'parent' => NamedDefinition._pcore_type,
2523     'attributes' => {
2524       'parent_class' => {
2525         'type' => Types::POptionalType.new(Types::PStringType::DEFAULT),
2526         'value' => nil
2527       }
2528     }
2529   })
2530 end
create(locator, offset, length, name, parameters = _pcore_type['parameters'].value, body = nil, parent_class = nil) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2547 def self.create(locator, offset, length, name, parameters = _pcore_type['parameters'].value, body = nil, parent_class = nil)
2548   ta = Types::TypeAsserter
2549   attrs = _pcore_type.attributes(true)
2550   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
2551   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
2552   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
2553   ta.assert_instance_of('Puppet::AST::NamedDefinition[name]', attrs['name'].type, name)
2554   ta.assert_instance_of('Puppet::AST::NamedDefinition[parameters]', attrs['parameters'].type, parameters)
2555   ta.assert_instance_of('Puppet::AST::NamedDefinition[body]', attrs['body'].type, body)
2556   ta.assert_instance_of('Puppet::AST::HostClassDefinition[parent_class]', attrs['parent_class'].type, parent_class)
2557   new(locator, offset, length, name, parameters, body, parent_class)
2558 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2536 def self.from_asserted_hash(init_hash)
2537   new(
2538     init_hash['locator'],
2539     init_hash['offset'],
2540     init_hash['length'],
2541     init_hash['name'],
2542     init_hash.fetch('parameters') { _pcore_type['parameters'].value },
2543     init_hash['body'],
2544     init_hash['parent_class'])
2545 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2532 def self.from_hash(init_hash)
2533   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::HostClassDefinition initializer', _pcore_type.init_hash_type, init_hash))
2534 end
new(locator, offset, length, name, parameters = _pcore_type['parameters'].value, body = nil, parent_class = nil) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2562 def initialize(locator, offset, length, name, parameters = _pcore_type['parameters'].value, body = nil, parent_class = nil)
2563   super(locator, offset, length, name, parameters, body)
2564   @hash = @hash ^ parent_class.hash
2565   @parent_class = parent_class
2566 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2579 def _pcore_all_contents(path, &block)
2580   path << self
2581   @parameters.each do |value|
2582     block.call(value, path)
2583     value._pcore_all_contents(path, &block)
2584   end
2585   unless @body.nil?
2586     block.call(@body, path)
2587     @body._pcore_all_contents(path, &block)
2588   end
2589   path.pop
2590 end
_pcore_contents() { |value| ... } click to toggle source
     # File lib/puppet/pops/model/ast.rb
2574 def _pcore_contents
2575   @parameters.each { |value| yield(value) }
2576   yield(@body) unless @body.nil?
2577 end
_pcore_init_hash() click to toggle source
Calls superclass method Puppet::Pops::Model::NamedDefinition#_pcore_init_hash
     # File lib/puppet/pops/model/ast.rb
2568 def _pcore_init_hash
2569   result = super
2570   result['parent_class'] = @parent_class unless @parent_class == nil
2571   result
2572 end
eql?(o) click to toggle source
     # File lib/puppet/pops/model/ast.rb
2592 def eql?(o)
2593   super &&
2594   @parent_class.eql?(o.parent_class)
2595 end
Also aliased as: ==