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 3858 def self._pcore_type 3859 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ResourceBody', { 3860 'parent' => Positioned._pcore_type, 3861 'attributes' => { 3862 'title' => { 3863 'type' => Types::POptionalType.new(Expression._pcore_type), 3864 'value' => nil 3865 }, 3866 'operations' => { 3867 'type' => Types::PArrayType.new(AbstractAttributeOperation._pcore_type), 3868 'value' => [] 3869 } 3870 } 3871 }) 3872 end
create(locator, offset, length, title = nil, operations = _pcore_type['operations'].value)
click to toggle source
# File lib/puppet/pops/model/ast.rb 3887 def self.create(locator, offset, length, title = nil, operations = _pcore_type['operations'].value) 3888 ta = Types::TypeAsserter 3889 attrs = _pcore_type.attributes(true) 3890 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 3891 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 3892 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 3893 ta.assert_instance_of('Puppet::AST::ResourceBody[title]', attrs['title'].type, title) 3894 ta.assert_instance_of('Puppet::AST::ResourceBody[operations]', attrs['operations'].type, operations) 3895 new(locator, offset, length, title, operations) 3896 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 3878 def self.from_asserted_hash(init_hash) 3879 new( 3880 init_hash['locator'], 3881 init_hash['offset'], 3882 init_hash['length'], 3883 init_hash['title'], 3884 init_hash.fetch('operations') { _pcore_type['operations'].value }) 3885 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 3874 def self.from_hash(init_hash) 3875 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ResourceBody initializer', _pcore_type.init_hash_type, init_hash)) 3876 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 3901 def initialize(locator, offset, length, title = nil, operations = _pcore_type['operations'].value) 3902 super(locator, offset, length) 3903 @hash = @hash ^ title.hash ^ operations.hash 3904 @title = title 3905 @operations = operations 3906 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 3920 def _pcore_all_contents(path, &block) 3921 path << self 3922 unless @title.nil? 3923 block.call(@title, path) 3924 @title._pcore_all_contents(path, &block) 3925 end 3926 @operations.each do |value| 3927 block.call(value, path) 3928 value._pcore_all_contents(path, &block) 3929 end 3930 path.pop 3931 end
_pcore_contents() { |title| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 3915 def _pcore_contents 3916 yield(@title) unless @title.nil? 3917 @operations.each { |value| yield(value) } 3918 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 3908 def _pcore_init_hash 3909 result = super 3910 result['title'] = @title unless @title == nil 3911 result['operations'] = @operations unless _pcore_type['operations'].default_value?(@operations) 3912 result 3913 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::PopsObject#eql?
# File lib/puppet/pops/model/ast.rb 3933 def eql?(o) 3934 super && 3935 @title.eql?(o.title) && 3936 @operations.eql?(o.operations) 3937 end
Also aliased as: ==