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