class Puppet::Pops::Model::AssignmentExpression
Attributes
operator[R]
Public Class Methods
_pcore_type()
click to toggle source
# File lib/puppet/pops/model/ast.rb 375 def self._pcore_type 376 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::AssignmentExpression', { 377 'parent' => BinaryExpression._pcore_type, 378 'attributes' => { 379 'operator' => Types::PEnumType.new(['+=', '-=', '=']) 380 } 381 }) 382 end
create(locator, offset, length, left_expr, right_expr, operator)
click to toggle source
# File lib/puppet/pops/model/ast.rb 398 def self.create(locator, offset, length, left_expr, right_expr, operator) 399 ta = Types::TypeAsserter 400 attrs = _pcore_type.attributes(true) 401 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 402 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 403 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 404 ta.assert_instance_of('Puppet::AST::BinaryExpression[left_expr]', attrs['left_expr'].type, left_expr) 405 ta.assert_instance_of('Puppet::AST::BinaryExpression[right_expr]', attrs['right_expr'].type, right_expr) 406 ta.assert_instance_of('Puppet::AST::AssignmentExpression[operator]', attrs['operator'].type, operator) 407 new(locator, offset, length, left_expr, right_expr, operator) 408 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 388 def self.from_asserted_hash(init_hash) 389 new( 390 init_hash['locator'], 391 init_hash['offset'], 392 init_hash['length'], 393 init_hash['left_expr'], 394 init_hash['right_expr'], 395 init_hash['operator']) 396 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 384 def self.from_hash(init_hash) 385 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::AssignmentExpression initializer', _pcore_type.init_hash_type, init_hash)) 386 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 412 def initialize(locator, offset, length, left_expr, right_expr, operator) 413 super(locator, offset, length, left_expr, right_expr) 414 @hash = @hash ^ operator.hash 415 @operator = operator 416 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 429 def _pcore_all_contents(path, &block) 430 path << self 431 unless @left_expr.nil? 432 block.call(@left_expr, path) 433 @left_expr._pcore_all_contents(path, &block) 434 end 435 unless @right_expr.nil? 436 block.call(@right_expr, path) 437 @right_expr._pcore_all_contents(path, &block) 438 end 439 path.pop 440 end
_pcore_contents() { |left_expr| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 424 def _pcore_contents 425 yield(@left_expr) unless @left_expr.nil? 426 yield(@right_expr) unless @right_expr.nil? 427 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 418 def _pcore_init_hash 419 result = super 420 result['operator'] = @operator 421 result 422 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::BinaryExpression#eql?
# File lib/puppet/pops/model/ast.rb 442 def eql?(o) 443 super && 444 @operator.eql?(o.operator) 445 end
Also aliased as: ==