class Puppet::Pops::Model::ResourceDefaultsExpression
Attributes
operations[R]
type_ref[R]
Public Class Methods
_pcore_type()
click to toggle source
# File lib/puppet/pops/model/ast.rb 4097 def self._pcore_type 4098 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ResourceDefaultsExpression', { 4099 'parent' => AbstractResource._pcore_type, 4100 'attributes' => { 4101 'type_ref' => { 4102 'type' => Types::POptionalType.new(Expression._pcore_type), 4103 'value' => nil 4104 }, 4105 'operations' => { 4106 'type' => Types::PArrayType.new(AbstractAttributeOperation._pcore_type), 4107 'value' => [] 4108 } 4109 } 4110 }) 4111 end
create(locator, offset, length, form = "regular", type_ref = nil, operations = _pcore_type['operations'].value)
click to toggle source
# File lib/puppet/pops/model/ast.rb 4127 def self.create(locator, offset, length, form = "regular", type_ref = nil, operations = _pcore_type['operations'].value) 4128 ta = Types::TypeAsserter 4129 attrs = _pcore_type.attributes(true) 4130 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 4131 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 4132 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 4133 ta.assert_instance_of('Puppet::AST::AbstractResource[form]', attrs['form'].type, form) 4134 ta.assert_instance_of('Puppet::AST::ResourceDefaultsExpression[type_ref]', attrs['type_ref'].type, type_ref) 4135 ta.assert_instance_of('Puppet::AST::ResourceDefaultsExpression[operations]', attrs['operations'].type, operations) 4136 new(locator, offset, length, form, type_ref, operations) 4137 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 4117 def self.from_asserted_hash(init_hash) 4118 new( 4119 init_hash['locator'], 4120 init_hash['offset'], 4121 init_hash['length'], 4122 init_hash.fetch('form') { "regular" }, 4123 init_hash['type_ref'], 4124 init_hash.fetch('operations') { _pcore_type['operations'].value }) 4125 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 4113 def self.from_hash(init_hash) 4114 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ResourceDefaultsExpression initializer', _pcore_type.init_hash_type, init_hash)) 4115 end
new(locator, offset, length, form = "regular", type_ref = nil, operations = _pcore_type['operations'].value)
click to toggle source
Calls superclass method
Puppet::Pops::Model::AbstractResource::new
# File lib/puppet/pops/model/ast.rb 4142 def initialize(locator, offset, length, form = "regular", type_ref = nil, operations = _pcore_type['operations'].value) 4143 super(locator, offset, length, form) 4144 @hash = @hash ^ type_ref.hash ^ operations.hash 4145 @type_ref = type_ref 4146 @operations = operations 4147 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 4161 def _pcore_all_contents(path, &block) 4162 path << self 4163 unless @type_ref.nil? 4164 block.call(@type_ref, path) 4165 @type_ref._pcore_all_contents(path, &block) 4166 end 4167 @operations.each do |value| 4168 block.call(value, path) 4169 value._pcore_all_contents(path, &block) 4170 end 4171 path.pop 4172 end
_pcore_contents() { |type_ref| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 4156 def _pcore_contents 4157 yield(@type_ref) unless @type_ref.nil? 4158 @operations.each { |value| yield(value) } 4159 end
_pcore_init_hash()
click to toggle source
Calls superclass method
Puppet::Pops::Model::AbstractResource#_pcore_init_hash
# File lib/puppet/pops/model/ast.rb 4149 def _pcore_init_hash 4150 result = super 4151 result['type_ref'] = @type_ref unless @type_ref == nil 4152 result['operations'] = @operations unless _pcore_type['operations'].default_value?(@operations) 4153 result 4154 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::AbstractResource#eql?
# File lib/puppet/pops/model/ast.rb 4174 def eql?(o) 4175 super && 4176 @type_ref.eql?(o.type_ref) && 4177 @operations.eql?(o.operations) 4178 end
Also aliased as: ==