class Puppet::Pops::Model::AttributeOperation
Attributes
attribute_name[R]
operator[R]
value_expr[R]
Public Class Methods
_pcore_type()
click to toggle source
# File lib/puppet/pops/model/ast.rb 1509 def self._pcore_type 1510 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::AttributeOperation', { 1511 'parent' => AbstractAttributeOperation._pcore_type, 1512 'attributes' => { 1513 'attribute_name' => Types::PStringType::DEFAULT, 1514 'operator' => Types::PEnumType.new(['+>', '=>']), 1515 'value_expr' => Expression._pcore_type 1516 } 1517 }) 1518 end
create(locator, offset, length, attribute_name, operator, value_expr)
click to toggle source
# File lib/puppet/pops/model/ast.rb 1534 def self.create(locator, offset, length, attribute_name, operator, value_expr) 1535 ta = Types::TypeAsserter 1536 attrs = _pcore_type.attributes(true) 1537 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 1538 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 1539 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 1540 ta.assert_instance_of('Puppet::AST::AttributeOperation[attribute_name]', attrs['attribute_name'].type, attribute_name) 1541 ta.assert_instance_of('Puppet::AST::AttributeOperation[operator]', attrs['operator'].type, operator) 1542 ta.assert_instance_of('Puppet::AST::AttributeOperation[value_expr]', attrs['value_expr'].type, value_expr) 1543 new(locator, offset, length, attribute_name, operator, value_expr) 1544 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 1524 def self.from_asserted_hash(init_hash) 1525 new( 1526 init_hash['locator'], 1527 init_hash['offset'], 1528 init_hash['length'], 1529 init_hash['attribute_name'], 1530 init_hash['operator'], 1531 init_hash['value_expr']) 1532 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 1520 def self.from_hash(init_hash) 1521 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::AttributeOperation initializer', _pcore_type.init_hash_type, init_hash)) 1522 end
new(locator, offset, length, attribute_name, operator, value_expr)
click to toggle source
Calls superclass method
Puppet::Pops::Model::Positioned::new
# File lib/puppet/pops/model/ast.rb 1550 def initialize(locator, offset, length, attribute_name, operator, value_expr) 1551 super(locator, offset, length) 1552 @hash = @hash ^ attribute_name.hash ^ operator.hash ^ value_expr.hash 1553 @attribute_name = attribute_name 1554 @operator = operator 1555 @value_expr = value_expr 1556 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 1570 def _pcore_all_contents(path, &block) 1571 path << self 1572 unless @value_expr.nil? 1573 block.call(@value_expr, path) 1574 @value_expr._pcore_all_contents(path, &block) 1575 end 1576 path.pop 1577 end
_pcore_contents() { |value_expr| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 1566 def _pcore_contents 1567 yield(@value_expr) unless @value_expr.nil? 1568 end
_pcore_init_hash()
click to toggle source
Calls superclass method
Puppet::Pops::Model::Positioned#_pcore_init_hash
# File lib/puppet/pops/model/ast.rb 1558 def _pcore_init_hash 1559 result = super 1560 result['attribute_name'] = @attribute_name 1561 result['operator'] = @operator 1562 result['value_expr'] = @value_expr 1563 result 1564 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::PopsObject#eql?
# File lib/puppet/pops/model/ast.rb 1579 def eql?(o) 1580 super && 1581 @attribute_name.eql?(o.attribute_name) && 1582 @operator.eql?(o.operator) && 1583 @value_expr.eql?(o.value_expr) 1584 end
Also aliased as: ==