class Puppet::Pops::Model::ResourceOverrideExpression
Attributes
operations[R]
resources[R]
Public Class Methods
_pcore_type()
click to toggle source
# File lib/puppet/pops/model/ast.rb 4184 def self._pcore_type 4185 @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ResourceOverrideExpression', { 4186 'parent' => AbstractResource._pcore_type, 4187 'attributes' => { 4188 'resources' => Expression._pcore_type, 4189 'operations' => { 4190 'type' => Types::PArrayType.new(AbstractAttributeOperation._pcore_type), 4191 'value' => [] 4192 } 4193 } 4194 }) 4195 end
create(locator, offset, length, resources, form = "regular", operations = _pcore_type['operations'].value)
click to toggle source
# File lib/puppet/pops/model/ast.rb 4211 def self.create(locator, offset, length, resources, form = "regular", operations = _pcore_type['operations'].value) 4212 ta = Types::TypeAsserter 4213 attrs = _pcore_type.attributes(true) 4214 ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator) 4215 ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset) 4216 ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length) 4217 ta.assert_instance_of('Puppet::AST::AbstractResource[form]', attrs['form'].type, form) 4218 ta.assert_instance_of('Puppet::AST::ResourceOverrideExpression[resources]', attrs['resources'].type, resources) 4219 ta.assert_instance_of('Puppet::AST::ResourceOverrideExpression[operations]', attrs['operations'].type, operations) 4220 new(locator, offset, length, resources, form, operations) 4221 end
from_asserted_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 4201 def self.from_asserted_hash(init_hash) 4202 new( 4203 init_hash['locator'], 4204 init_hash['offset'], 4205 init_hash['length'], 4206 init_hash['resources'], 4207 init_hash.fetch('form') { "regular" }, 4208 init_hash.fetch('operations') { _pcore_type['operations'].value }) 4209 end
from_hash(init_hash)
click to toggle source
# File lib/puppet/pops/model/ast.rb 4197 def self.from_hash(init_hash) 4198 from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ResourceOverrideExpression initializer', _pcore_type.init_hash_type, init_hash)) 4199 end
new(locator, offset, length, resources, form = "regular", operations = _pcore_type['operations'].value)
click to toggle source
Calls superclass method
Puppet::Pops::Model::AbstractResource::new
# File lib/puppet/pops/model/ast.rb 4226 def initialize(locator, offset, length, resources, form = "regular", operations = _pcore_type['operations'].value) 4227 super(locator, offset, length, form) 4228 @hash = @hash ^ resources.hash ^ operations.hash 4229 @resources = resources 4230 @operations = operations 4231 end
Public Instance Methods
_pcore_all_contents(path, &block)
click to toggle source
# File lib/puppet/pops/model/ast.rb 4245 def _pcore_all_contents(path, &block) 4246 path << self 4247 unless @resources.nil? 4248 block.call(@resources, path) 4249 @resources._pcore_all_contents(path, &block) 4250 end 4251 @operations.each do |value| 4252 block.call(value, path) 4253 value._pcore_all_contents(path, &block) 4254 end 4255 path.pop 4256 end
_pcore_contents() { |resources| ... }
click to toggle source
# File lib/puppet/pops/model/ast.rb 4240 def _pcore_contents 4241 yield(@resources) unless @resources.nil? 4242 @operations.each { |value| yield(value) } 4243 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 4233 def _pcore_init_hash 4234 result = super 4235 result['resources'] = @resources 4236 result['operations'] = @operations unless _pcore_type['operations'].default_value?(@operations) 4237 result 4238 end
eql?(o)
click to toggle source
Calls superclass method
Puppet::Pops::Model::AbstractResource#eql?
# File lib/puppet/pops/model/ast.rb 4258 def eql?(o) 4259 super && 4260 @resources.eql?(o.resources) && 4261 @operations.eql?(o.operations) 4262 end
Also aliased as: ==