class Puppet::Pops::Model::RelationshipExpression
Attributes
operator[R]
Public Class Methods
_pcore_type()
click to toggle source
# File lib/puppet/pops/model/ast.rb 526 def self._pcore_type 527 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::RelationshipExpression', { 528 'parent' => BinaryExpression._pcore_type, 529 'attributes' => { 530 'operator' => Types::PEnumType.new(['->', '<-', '<~', '~>']) 531 } 532 }) 533 end
create(locator, offset, length, left_expr, right_expr, operator)
click to toggle source
# File lib/puppet/pops/model/ast.rb 549 def self.create(locator, offset, length, left_expr, right_expr, operator) 550 ta = Types::TypeAsserter 551 attrs = _pcore_type.attributes(true) 552 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 553 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 554 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 555 ta.assert_instance_of('Puppet::AST::BinaryExpression[left_expr]', attrs['left_expr'].type, left_expr) 556 ta.assert_instance_of('Puppet::AST::BinaryExpression[right_expr]', attrs['right_expr'].type, right_expr) 557 ta.assert_instance_of('Puppet::AST::RelationshipExpression[operator]', attrs['operator'].type, operator) 558 new(locator, offset, length, left_expr, right_expr, operator) 559 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 539 def self.from_asserted_hash(init_hash) 540 new( 541 init_hash['locator'], 542 init_hash['offset'], 543 init_hash['length'], 544 init_hash['left_expr'], 545 init_hash['right_expr'], 546 init_hash['operator']) 547 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 535 def self.from_hash(init_hash) 536 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::RelationshipExpression initializer', _pcore_type.init_hash_type, init_hash)) 537 end
new(locator, offset, length, left_expr, right_expr, operator)
click to toggle source
Calls superclass method
Puppet::Pops::Model::BinaryExpression::new
# File lib/puppet/pops/model/ast.rb 563 def initialize(locator, offset, length, left_expr, right_expr, operator) 564 super(locator, offset, length, left_expr, right_expr) 565 @hash = @hash ^ operator.hash 566 @operator = operator 567 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 580 def _pcore_all_contents(path, &block) 581 path << self 582 unless @left_expr.nil? 583 block.call(@left_expr, path) 584 @left_expr._pcore_all_contents(path, &block) 585 end 586 unless @right_expr.nil? 587 block.call(@right_expr, path) 588 @right_expr._pcore_all_contents(path, &block) 589 end 590 path.pop 591 end
_pcore_contents() { |left_expr| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 575 def _pcore_contents 576 yield(@left_expr) unless @left_expr.nil? 577 yield(@right_expr) unless @right_expr.nil? 578 end
_pcore_init_hash()
click to toggle source
Calls superclass method
Puppet::Pops::Model::BinaryExpression#_pcore_init_hash
# File lib/puppet/pops/model/ast.rb 569 def _pcore_init_hash 570 result = super 571 result['operator'] = @operator 572 result 573 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::BinaryExpression#eql?
# File lib/puppet/pops/model/ast.rb 593 def eql?(o) 594 super && 595 @operator.eql?(o.operator) 596 end
Also aliased as: ==