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