class Puppet::Pops::Model::QueryExpression

Attributes

expr[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
1390 def self._pcore_type
1391   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::QueryExpression', {
1392     'parent' => Expression._pcore_type,
1393     'attributes' => {
1394       'expr' => {
1395         'type' => Types::POptionalType.new(Expression._pcore_type),
1396         'value' => nil
1397       }
1398     }
1399   })
1400 end
create(locator, offset, length, expr = nil) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1414 def self.create(locator, offset, length, expr = nil)
1415   ta = Types::TypeAsserter
1416   attrs = _pcore_type.attributes(true)
1417   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1418   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1419   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1420   ta.assert_instance_of('Puppet::AST::QueryExpression[expr]', attrs['expr'].type, expr)
1421   new(locator, offset, length, expr)
1422 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1406 def self.from_asserted_hash(init_hash)
1407   new(
1408     init_hash['locator'],
1409     init_hash['offset'],
1410     init_hash['length'],
1411     init_hash['expr'])
1412 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1402 def self.from_hash(init_hash)
1403   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::QueryExpression initializer', _pcore_type.init_hash_type, init_hash))
1404 end
new(locator, offset, length, expr = nil) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
     # File lib/puppet/pops/model/ast.rb
1426 def initialize(locator, offset, length, expr = nil)
1427   super(locator, offset, length)
1428   @hash = @hash ^ expr.hash
1429   @expr = expr
1430 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1442 def _pcore_all_contents(path, &block)
1443   path << self
1444   unless @expr.nil?
1445     block.call(@expr, path)
1446     @expr._pcore_all_contents(path, &block)
1447   end
1448   path.pop
1449 end
_pcore_contents() { |expr| ... } click to toggle source
     # File lib/puppet/pops/model/ast.rb
1438 def _pcore_contents
1439   yield(@expr) unless @expr.nil?
1440 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
1432 def _pcore_init_hash
1433   result = super
1434   result['expr'] = @expr unless @expr == nil
1435   result
1436 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
1451 def eql?(o)
1452   super &&
1453   @expr.eql?(o.expr)
1454 end
Also aliased as: ==