class Puppet::Pops::Model::SelectorExpression
Attributes
left_expr[R]
selectors[R]
Public Class Methods
_pcore_type()
click to toggle source
# File lib/puppet/pops/model/ast.rb 4344 def self._pcore_type 4345 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::SelectorExpression', { 4346 'parent' => Expression._pcore_type, 4347 'attributes' => { 4348 'left_expr' => Expression._pcore_type, 4349 'selectors' => { 4350 'type' => Types::PArrayType.new(SelectorEntry._pcore_type), 4351 'value' => [] 4352 } 4353 } 4354 }) 4355 end
create(locator, offset, length, left_expr, selectors = _pcore_type['selectors'].value)
click to toggle source
# File lib/puppet/pops/model/ast.rb 4370 def self.create(locator, offset, length, left_expr, selectors = _pcore_type['selectors'].value) 4371 ta = Types::TypeAsserter 4372 attrs = _pcore_type.attributes(true) 4373 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 4374 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 4375 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 4376 ta.assert_instance_of('Puppet::AST::SelectorExpression[left_expr]', attrs['left_expr'].type, left_expr) 4377 ta.assert_instance_of('Puppet::AST::SelectorExpression[selectors]', attrs['selectors'].type, selectors) 4378 new(locator, offset, length, left_expr, selectors) 4379 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 4361 def self.from_asserted_hash(init_hash) 4362 new( 4363 init_hash['locator'], 4364 init_hash['offset'], 4365 init_hash['length'], 4366 init_hash['left_expr'], 4367 init_hash.fetch('selectors') { _pcore_type['selectors'].value }) 4368 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 4357 def self.from_hash(init_hash) 4358 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::SelectorExpression initializer', _pcore_type.init_hash_type, init_hash)) 4359 end
new(locator, offset, length, left_expr, selectors = _pcore_type['selectors'].value)
click to toggle source
Calls superclass method
Puppet::Pops::Model::Positioned::new
# File lib/puppet/pops/model/ast.rb 4384 def initialize(locator, offset, length, left_expr, selectors = _pcore_type['selectors'].value) 4385 super(locator, offset, length) 4386 @hash = @hash ^ left_expr.hash ^ selectors.hash 4387 @left_expr = left_expr 4388 @selectors = selectors 4389 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 4403 def _pcore_all_contents(path, &block) 4404 path << self 4405 unless @left_expr.nil? 4406 block.call(@left_expr, path) 4407 @left_expr._pcore_all_contents(path, &block) 4408 end 4409 @selectors.each do |value| 4410 block.call(value, path) 4411 value._pcore_all_contents(path, &block) 4412 end 4413 path.pop 4414 end
_pcore_contents() { |left_expr| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 4398 def _pcore_contents 4399 yield(@left_expr) unless @left_expr.nil? 4400 @selectors.each { |value| yield(value) } 4401 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 4391 def _pcore_init_hash 4392 result = super 4393 result['left_expr'] = @left_expr 4394 result['selectors'] = @selectors unless _pcore_type['selectors'].default_value?(@selectors) 4395 result 4396 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::PopsObject#eql?
# File lib/puppet/pops/model/ast.rb 4416 def eql?(o) 4417 super && 4418 @left_expr.eql?(o.left_expr) && 4419 @selectors.eql?(o.selectors) 4420 end
Also aliased as: ==