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