class Puppet::Pops::Model::BlockExpression

Attributes

statements[R]

Public Class Methods

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

Public Instance Methods

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