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 1655 def self._pcore_type 1656 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::CollectExpression', { 1657 'parent' => Expression._pcore_type, 1658 'attributes' => { 1659 'type_expr' => Expression._pcore_type, 1660 'query' => QueryExpression._pcore_type, 1661 'operations' => { 1662 'type' => Types::PArrayType.new(AbstractAttributeOperation._pcore_type), 1663 'value' => [] 1664 } 1665 } 1666 }) 1667 end
create(locator, offset, length, type_expr, query, operations = _pcore_type['operations'].value)
click to toggle source
# File lib/puppet/pops/model/ast.rb 1683 def self.create(locator, offset, length, type_expr, query, operations = _pcore_type['operations'].value) 1684 ta = Types::TypeAsserter 1685 attrs = _pcore_type.attributes(true) 1686 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 1687 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 1688 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 1689 ta.assert_instance_of('Puppet::AST::CollectExpression[type_expr]', attrs['type_expr'].type, type_expr) 1690 ta.assert_instance_of('Puppet::AST::CollectExpression[query]', attrs['query'].type, query) 1691 ta.assert_instance_of('Puppet::AST::CollectExpression[operations]', attrs['operations'].type, operations) 1692 new(locator, offset, length, type_expr, query, operations) 1693 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 1673 def self.from_asserted_hash(init_hash) 1674 new( 1675 init_hash['locator'], 1676 init_hash['offset'], 1677 init_hash['length'], 1678 init_hash['type_expr'], 1679 init_hash['query'], 1680 init_hash.fetch('operations') { _pcore_type['operations'].value }) 1681 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 1669 def self.from_hash(init_hash) 1670 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::CollectExpression initializer', _pcore_type.init_hash_type, init_hash)) 1671 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 1699 def initialize(locator, offset, length, type_expr, query, operations = _pcore_type['operations'].value) 1700 super(locator, offset, length) 1701 @hash = @hash ^ type_expr.hash ^ query.hash ^ operations.hash 1702 @type_expr = type_expr 1703 @query = query 1704 @operations = operations 1705 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 1721 def _pcore_all_contents(path, &block) 1722 path << self 1723 unless @type_expr.nil? 1724 block.call(@type_expr, path) 1725 @type_expr._pcore_all_contents(path, &block) 1726 end 1727 unless @query.nil? 1728 block.call(@query, path) 1729 @query._pcore_all_contents(path, &block) 1730 end 1731 @operations.each do |value| 1732 block.call(value, path) 1733 value._pcore_all_contents(path, &block) 1734 end 1735 path.pop 1736 end
_pcore_contents() { |type_expr| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 1715 def _pcore_contents 1716 yield(@type_expr) unless @type_expr.nil? 1717 yield(@query) unless @query.nil? 1718 @operations.each { |value| yield(value) } 1719 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 1707 def _pcore_init_hash 1708 result = super 1709 result['type_expr'] = @type_expr 1710 result['query'] = @query 1711 result['operations'] = @operations unless _pcore_type['operations'].default_value?(@operations) 1712 result 1713 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::PopsObject#eql?
# File lib/puppet/pops/model/ast.rb 1738 def eql?(o) 1739 super && 1740 @type_expr.eql?(o.type_expr) && 1741 @query.eql?(o.query) && 1742 @operations.eql?(o.operations) 1743 end
Also aliased as: ==