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