class Puppet::Pops::Model::AccessExpression

Attributes

keys[R]
left_expr[R]

Public Class Methods

_pcore_type() click to toggle source
    # File lib/puppet/pops/model/ast.rb
601 def self._pcore_type
602   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::AccessExpression', {
603     'parent' => Expression._pcore_type,
604     'attributes' => {
605       'left_expr' => Expression._pcore_type,
606       'keys' => {
607         'type' => Types::PArrayType.new(Expression._pcore_type),
608         'value' => []
609       }
610     }
611   })
612 end
create(locator, offset, length, left_expr, keys = _pcore_type['keys'].value) click to toggle source
    # File lib/puppet/pops/model/ast.rb
627 def self.create(locator, offset, length, left_expr, keys = _pcore_type['keys'].value)
628   ta = Types::TypeAsserter
629   attrs = _pcore_type.attributes(true)
630   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
631   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
632   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
633   ta.assert_instance_of('Puppet::AST::AccessExpression[left_expr]', attrs['left_expr'].type, left_expr)
634   ta.assert_instance_of('Puppet::AST::AccessExpression[keys]', attrs['keys'].type, keys)
635   new(locator, offset, length, left_expr, keys)
636 end
from_asserted_hash(init_hash) click to toggle source
    # File lib/puppet/pops/model/ast.rb
618 def self.from_asserted_hash(init_hash)
619   new(
620     init_hash['locator'],
621     init_hash['offset'],
622     init_hash['length'],
623     init_hash['left_expr'],
624     init_hash.fetch('keys') { _pcore_type['keys'].value })
625 end
from_hash(init_hash) click to toggle source
    # File lib/puppet/pops/model/ast.rb
614 def self.from_hash(init_hash)
615   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::AccessExpression initializer', _pcore_type.init_hash_type, init_hash))
616 end
new(locator, offset, length, left_expr, keys = _pcore_type['keys'].value) click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
    # File lib/puppet/pops/model/ast.rb
641 def initialize(locator, offset, length, left_expr, keys = _pcore_type['keys'].value)
642   super(locator, offset, length)
643   @hash = @hash ^ left_expr.hash ^ keys.hash
644   @left_expr = left_expr
645   @keys = keys
646 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
    # File lib/puppet/pops/model/ast.rb
660 def _pcore_all_contents(path, &block)
661   path << self
662   unless @left_expr.nil?
663     block.call(@left_expr, path)
664     @left_expr._pcore_all_contents(path, &block)
665   end
666   @keys.each do |value|
667     block.call(value, path)
668     value._pcore_all_contents(path, &block)
669   end
670   path.pop
671 end
_pcore_contents() { |left_expr| ... } click to toggle source
    # File lib/puppet/pops/model/ast.rb
655 def _pcore_contents
656   yield(@left_expr) unless @left_expr.nil?
657   @keys.each { |value| yield(value) }
658 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
648 def _pcore_init_hash
649   result = super
650   result['left_expr'] = @left_expr
651   result['keys'] = @keys unless _pcore_type['keys'].default_value?(@keys)
652   result
653 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
    # File lib/puppet/pops/model/ast.rb
673 def eql?(o)
674   super &&
675   @left_expr.eql?(o.left_expr) &&
676   @keys.eql?(o.keys)
677 end
Also aliased as: ==