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 2521 def self._pcore_type 2522 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::HostClassDefinition', { 2523 'parent' => NamedDefinition._pcore_type, 2524 'attributes' => { 2525 'parent_class' => { 2526 'type' => Types::POptionalType.new(Types::PStringType::DEFAULT), 2527 'value' => nil 2528 } 2529 } 2530 }) 2531 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 2548 def self.create(locator, offset, length, name, parameters = _pcore_type['parameters'].value, body = nil, parent_class = nil) 2549 ta = Types::TypeAsserter 2550 attrs = _pcore_type.attributes(true) 2551 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 2552 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 2553 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 2554 ta.assert_instance_of('Puppet::AST::NamedDefinition[name]', attrs['name'].type, name) 2555 ta.assert_instance_of('Puppet::AST::NamedDefinition[parameters]', attrs['parameters'].type, parameters) 2556 ta.assert_instance_of('Puppet::AST::NamedDefinition[body]', attrs['body'].type, body) 2557 ta.assert_instance_of('Puppet::AST::HostClassDefinition[parent_class]', attrs['parent_class'].type, parent_class) 2558 new(locator, offset, length, name, parameters, body, parent_class) 2559 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 2537 def self.from_asserted_hash(init_hash) 2538 new( 2539 init_hash['locator'], 2540 init_hash['offset'], 2541 init_hash['length'], 2542 init_hash['name'], 2543 init_hash.fetch('parameters') { _pcore_type['parameters'].value }, 2544 init_hash['body'], 2545 init_hash['parent_class']) 2546 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 2533 def self.from_hash(init_hash) 2534 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::HostClassDefinition initializer', _pcore_type.init_hash_type, init_hash)) 2535 end
new(locator, offset, length, name, parameters = _pcore_type['parameters'].value, body = nil, parent_class = nil)
click to toggle source
Calls superclass method
Puppet::Pops::Model::NamedDefinition::new
# File lib/puppet/pops/model/ast.rb 2563 def initialize(locator, offset, length, name, parameters = _pcore_type['parameters'].value, body = nil, parent_class = nil) 2564 super(locator, offset, length, name, parameters, body) 2565 @hash = @hash ^ parent_class.hash 2566 @parent_class = parent_class 2567 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 2580 def _pcore_all_contents(path, &block) 2581 path << self 2582 @parameters.each do |value| 2583 block.call(value, path) 2584 value._pcore_all_contents(path, &block) 2585 end 2586 unless @body.nil? 2587 block.call(@body, path) 2588 @body._pcore_all_contents(path, &block) 2589 end 2590 path.pop 2591 end
_pcore_contents() { |value| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 2575 def _pcore_contents 2576 @parameters.each { |value| yield(value) } 2577 yield(@body) unless @body.nil? 2578 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 2569 def _pcore_init_hash 2570 result = super 2571 result['parent_class'] = @parent_class unless @parent_class == nil 2572 result 2573 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::NamedDefinition#eql?
# File lib/puppet/pops/model/ast.rb 2593 def eql?(o) 2594 super && 2595 @parent_class.eql?(o.parent_class) 2596 end
Also aliased as: ==