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

Public Instance Methods

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