class Puppet::Pops::Model::SelectorEntry

Attributes

matching_expr[R]
value_expr[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
4267 def self._pcore_type
4268   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::SelectorEntry', {
4269     'parent' => Positioned._pcore_type,
4270     'attributes' => {
4271       'matching_expr' => Expression._pcore_type,
4272       'value_expr' => Expression._pcore_type
4273     }
4274   })
4275 end
create(locator, offset, length, matching_expr, value_expr) click to toggle source
     # File lib/puppet/pops/model/ast.rb
4290 def self.create(locator, offset, length, matching_expr, value_expr)
4291   ta = Types::TypeAsserter
4292   attrs = _pcore_type.attributes(true)
4293   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
4294   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
4295   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
4296   ta.assert_instance_of('Puppet::AST::SelectorEntry[matching_expr]', attrs['matching_expr'].type, matching_expr)
4297   ta.assert_instance_of('Puppet::AST::SelectorEntry[value_expr]', attrs['value_expr'].type, value_expr)
4298   new(locator, offset, length, matching_expr, value_expr)
4299 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
4281 def self.from_asserted_hash(init_hash)
4282   new(
4283     init_hash['locator'],
4284     init_hash['offset'],
4285     init_hash['length'],
4286     init_hash['matching_expr'],
4287     init_hash['value_expr'])
4288 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
4277 def self.from_hash(init_hash)
4278   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::SelectorEntry initializer', _pcore_type.init_hash_type, init_hash))
4279 end
new(locator, offset, length, matching_expr, value_expr) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
     # File lib/puppet/pops/model/ast.rb
4304 def initialize(locator, offset, length, matching_expr, value_expr)
4305   super(locator, offset, length)
4306   @hash = @hash ^ matching_expr.hash ^ value_expr.hash
4307   @matching_expr = matching_expr
4308   @value_expr = value_expr
4309 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
     # File lib/puppet/pops/model/ast.rb
4323 def _pcore_all_contents(path, &block)
4324   path << self
4325   unless @matching_expr.nil?
4326     block.call(@matching_expr, path)
4327     @matching_expr._pcore_all_contents(path, &block)
4328   end
4329   unless @value_expr.nil?
4330     block.call(@value_expr, path)
4331     @value_expr._pcore_all_contents(path, &block)
4332   end
4333   path.pop
4334 end
_pcore_contents() { |matching_expr| ... } click to toggle source
     # File lib/puppet/pops/model/ast.rb
4318 def _pcore_contents
4319   yield(@matching_expr) unless @matching_expr.nil?
4320   yield(@value_expr) unless @value_expr.nil?
4321 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
4311 def _pcore_init_hash
4312   result = super
4313   result['matching_expr'] = @matching_expr
4314   result['value_expr'] = @value_expr
4315   result
4316 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
4336 def eql?(o)
4337   super &&
4338   @matching_expr.eql?(o.matching_expr) &&
4339   @value_expr.eql?(o.value_expr)
4340 end
Also aliased as: ==