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

Public Instance Methods

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