class Puppet::Pops::Model::CollectExpression

Attributes

operations[R]
query[R]
type_expr[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
1656 def self._pcore_type
1657   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::CollectExpression', {
1658     'parent' => Expression._pcore_type,
1659     'attributes' => {
1660       'type_expr' => Expression._pcore_type,
1661       'query' => QueryExpression._pcore_type,
1662       'operations' => {
1663         'type' => Types::PArrayType.new(AbstractAttributeOperation._pcore_type),
1664         'value' => []
1665       }
1666     }
1667   })
1668 end
create(locator, offset, length, type_expr, query, operations = _pcore_type['operations'].value) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1684 def self.create(locator, offset, length, type_expr, query, operations = _pcore_type['operations'].value)
1685   ta = Types::TypeAsserter
1686   attrs = _pcore_type.attributes(true)
1687   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
1688   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
1689   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
1690   ta.assert_instance_of('Puppet::AST::CollectExpression[type_expr]', attrs['type_expr'].type, type_expr)
1691   ta.assert_instance_of('Puppet::AST::CollectExpression[query]', attrs['query'].type, query)
1692   ta.assert_instance_of('Puppet::AST::CollectExpression[operations]', attrs['operations'].type, operations)
1693   new(locator, offset, length, type_expr, query, operations)
1694 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1674 def self.from_asserted_hash(init_hash)
1675   new(
1676     init_hash['locator'],
1677     init_hash['offset'],
1678     init_hash['length'],
1679     init_hash['type_expr'],
1680     init_hash['query'],
1681     init_hash.fetch('operations') { _pcore_type['operations'].value })
1682 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1670 def self.from_hash(init_hash)
1671   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::CollectExpression initializer', _pcore_type.init_hash_type, init_hash))
1672 end
new(locator, offset, length, type_expr, query, operations = _pcore_type['operations'].value) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
     # File lib/puppet/pops/model/ast.rb
1700 def initialize(locator, offset, length, type_expr, query, operations = _pcore_type['operations'].value)
1701   super(locator, offset, length)
1702   @hash = @hash ^ type_expr.hash ^ query.hash ^ operations.hash
1703   @type_expr = type_expr
1704   @query = query
1705   @operations = operations
1706 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
     # File lib/puppet/pops/model/ast.rb
1722 def _pcore_all_contents(path, &block)
1723   path << self
1724   unless @type_expr.nil?
1725     block.call(@type_expr, path)
1726     @type_expr._pcore_all_contents(path, &block)
1727   end
1728   unless @query.nil?
1729     block.call(@query, path)
1730     @query._pcore_all_contents(path, &block)
1731   end
1732   @operations.each do |value|
1733     block.call(value, path)
1734     value._pcore_all_contents(path, &block)
1735   end
1736   path.pop
1737 end
_pcore_contents() { |type_expr| ... } click to toggle source
     # File lib/puppet/pops/model/ast.rb
1716 def _pcore_contents
1717   yield(@type_expr) unless @type_expr.nil?
1718   yield(@query) unless @query.nil?
1719   @operations.each { |value| yield(value) }
1720 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
1708 def _pcore_init_hash
1709   result = super
1710   result['type_expr'] = @type_expr
1711   result['query'] = @query
1712   result['operations'] = @operations unless _pcore_type['operations'].default_value?(@operations)
1713   result
1714 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
1739 def eql?(o)
1740   super &&
1741   @type_expr.eql?(o.type_expr) &&
1742   @query.eql?(o.query) &&
1743   @operations.eql?(o.operations)
1744 end
Also aliased as: ==