class Puppet::Pops::Model::ArithmeticExpression
Attributes
operator[R]
Public Class Methods
_pcore_type()
click to toggle source
# File lib/puppet/pops/model/ast.rb 450 def self._pcore_type 451 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ArithmeticExpression', { 452 'parent' => BinaryExpression._pcore_type, 453 'attributes' => { 454 'operator' => Types::PEnumType.new(['%', '*', '+', '-', '/', '<<', '>>']) 455 } 456 }) 457 end
create(locator, offset, length, left_expr, right_expr, operator)
click to toggle source
# File lib/puppet/pops/model/ast.rb 473 def self.create(locator, offset, length, left_expr, right_expr, operator) 474 ta = Types::TypeAsserter 475 attrs = _pcore_type.attributes(true) 476 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 477 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 478 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 479 ta.assert_instance_of('Puppet::AST::BinaryExpression[left_expr]', attrs['left_expr'].type, left_expr) 480 ta.assert_instance_of('Puppet::AST::BinaryExpression[right_expr]', attrs['right_expr'].type, right_expr) 481 ta.assert_instance_of('Puppet::AST::ArithmeticExpression[operator]', attrs['operator'].type, operator) 482 new(locator, offset, length, left_expr, right_expr, operator) 483 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 463 def self.from_asserted_hash(init_hash) 464 new( 465 init_hash['locator'], 466 init_hash['offset'], 467 init_hash['length'], 468 init_hash['left_expr'], 469 init_hash['right_expr'], 470 init_hash['operator']) 471 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 459 def self.from_hash(init_hash) 460 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ArithmeticExpression initializer', _pcore_type.init_hash_type, init_hash)) 461 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 487 def initialize(locator, offset, length, left_expr, right_expr, operator) 488 super(locator, offset, length, left_expr, right_expr) 489 @hash = @hash ^ operator.hash 490 @operator = operator 491 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 504 def _pcore_all_contents(path, &block) 505 path << self 506 unless @left_expr.nil? 507 block.call(@left_expr, path) 508 @left_expr._pcore_all_contents(path, &block) 509 end 510 unless @right_expr.nil? 511 block.call(@right_expr, path) 512 @right_expr._pcore_all_contents(path, &block) 513 end 514 path.pop 515 end
_pcore_contents() { |left_expr| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 499 def _pcore_contents 500 yield(@left_expr) unless @left_expr.nil? 501 yield(@right_expr) unless @right_expr.nil? 502 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 493 def _pcore_init_hash 494 result = super 495 result['operator'] = @operator 496 result 497 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::BinaryExpression#eql?
# File lib/puppet/pops/model/ast.rb 517 def eql?(o) 518 super && 519 @operator.eql?(o.operator) 520 end
Also aliased as: ==