class Puppet::Pops::Model::ResourceBody

Attributes

operations[R]
title[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
3859 def self._pcore_type
3860   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ResourceBody', {
3861     'parent' => Positioned._pcore_type,
3862     'attributes' => {
3863       'title' => {
3864         'type' => Types::POptionalType.new(Expression._pcore_type),
3865         'value' => nil
3866       },
3867       'operations' => {
3868         'type' => Types::PArrayType.new(AbstractAttributeOperation._pcore_type),
3869         'value' => []
3870       }
3871     }
3872   })
3873 end
create(locator, offset, length, title = nil, operations = _pcore_type['operations'].value) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3888 def self.create(locator, offset, length, title = nil, operations = _pcore_type['operations'].value)
3889   ta = Types::TypeAsserter
3890   attrs = _pcore_type.attributes(true)
3891   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3892   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3893   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3894   ta.assert_instance_of('Puppet::AST::ResourceBody[title]', attrs['title'].type, title)
3895   ta.assert_instance_of('Puppet::AST::ResourceBody[operations]', attrs['operations'].type, operations)
3896   new(locator, offset, length, title, operations)
3897 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3879 def self.from_asserted_hash(init_hash)
3880   new(
3881     init_hash['locator'],
3882     init_hash['offset'],
3883     init_hash['length'],
3884     init_hash['title'],
3885     init_hash.fetch('operations') { _pcore_type['operations'].value })
3886 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3875 def self.from_hash(init_hash)
3876   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ResourceBody initializer', _pcore_type.init_hash_type, init_hash))
3877 end
new(locator, offset, length, title = nil, operations = _pcore_type['operations'].value) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
     # File lib/puppet/pops/model/ast.rb
3902 def initialize(locator, offset, length, title = nil, operations = _pcore_type['operations'].value)
3903   super(locator, offset, length)
3904   @hash = @hash ^ title.hash ^ operations.hash
3905   @title = title
3906   @operations = operations
3907 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3921 def _pcore_all_contents(path, &block)
3922   path << self
3923   unless @title.nil?
3924     block.call(@title, path)
3925     @title._pcore_all_contents(path, &block)
3926   end
3927   @operations.each do |value|
3928     block.call(value, path)
3929     value._pcore_all_contents(path, &block)
3930   end
3931   path.pop
3932 end
_pcore_contents() { |title| ... } click to toggle source
     # File lib/puppet/pops/model/ast.rb
3916 def _pcore_contents
3917   yield(@title) unless @title.nil?
3918   @operations.each { |value| yield(value) }
3919 end
_pcore_init_hash() click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned#_pcore_init_hash
     # File lib/puppet/pops/model/ast.rb
3909 def _pcore_init_hash
3910   result = super
3911   result['title'] = @title unless @title == nil
3912   result['operations'] = @operations unless _pcore_type['operations'].default_value?(@operations)
3913   result
3914 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
3934 def eql?(o)
3935   super &&
3936   @title.eql?(o.title) &&
3937   @operations.eql?(o.operations)
3938 end
Also aliased as: ==