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