class Puppet::Pops::Model::BlockExpression

Attributes

statements[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
1152 def self._pcore_type
1153   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::BlockExpression', {
1154     'parent' => Expression._pcore_type,
1155     'attributes' => {
1156       'statements' => {
1157         'type' => Types::PArrayType.new(Expression._pcore_type),
1158         'value' => []
1159       }
1160     }
1161   })
1162 end
create(locator, offset, length, statements = _pcore_type['statements'].value) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1176 def self.create(locator, offset, length, statements = _pcore_type['statements'].value)
1177   ta = Types::TypeAsserter
1178   attrs = _pcore_type.attributes(true)
1179   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1180   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1181   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1182   ta.assert_instance_of('Puppet::AST::BlockExpression[statements]', attrs['statements'].type, statements)
1183   new(locator, offset, length, statements)
1184 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1168 def self.from_asserted_hash(init_hash)
1169   new(
1170     init_hash['locator'],
1171     init_hash['offset'],
1172     init_hash['length'],
1173     init_hash.fetch('statements') { _pcore_type['statements'].value })
1174 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1164 def self.from_hash(init_hash)
1165   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::BlockExpression initializer', _pcore_type.init_hash_type, init_hash))
1166 end
new(locator, offset, length, statements = _pcore_type['statements'].value) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
     # File lib/puppet/pops/model/ast.rb
1188 def initialize(locator, offset, length, statements = _pcore_type['statements'].value)
1189   super(locator, offset, length)
1190   @hash = @hash ^ statements.hash
1191   @statements = statements
1192 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1204 def _pcore_all_contents(path, &block)
1205   path << self
1206   @statements.each do |value|
1207     block.call(value, path)
1208     value._pcore_all_contents(path, &block)
1209   end
1210   path.pop
1211 end
_pcore_contents() { |value| ... } click to toggle source
     # File lib/puppet/pops/model/ast.rb
1200 def _pcore_contents
1201   @statements.each { |value| yield(value) }
1202 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
1194 def _pcore_init_hash
1195   result = super
1196   result['statements'] = @statements unless _pcore_type['statements'].default_value?(@statements)
1197   result
1198 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
1213 def eql?(o)
1214   super &&
1215   @statements.eql?(o.statements)
1216 end
Also aliased as: ==