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
4183 def self._pcore_type
4184   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::ResourceOverrideExpression', {
4185     'parent' => AbstractResource._pcore_type,
4186     'attributes' => {
4187       'resources' => Expression._pcore_type,
4188       'operations' => {
4189         'type' => Types::PArrayType.new(AbstractAttributeOperation._pcore_type),
4190         'value' => []
4191       }
4192     }
4193   })
4194 end
create(locator, offset, length, resources, form = "regular", operations = _pcore_type['operations'].value) click to toggle source
     # File lib/puppet/pops/model/ast.rb
4210 def self.create(locator, offset, length, resources, form = "regular", operations = _pcore_type['operations'].value)
4211   ta = Types::TypeAsserter
4212   attrs = _pcore_type.attributes(true)
4213   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
4214   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
4215   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
4216   ta.assert_instance_of('Puppet::AST::AbstractResource[form]', attrs['form'].type, form)
4217   ta.assert_instance_of('Puppet::AST::ResourceOverrideExpression[resources]', attrs['resources'].type, resources)
4218   ta.assert_instance_of('Puppet::AST::ResourceOverrideExpression[operations]', attrs['operations'].type, operations)
4219   new(locator, offset, length, resources, form, operations)
4220 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
4200 def self.from_asserted_hash(init_hash)
4201   new(
4202     init_hash['locator'],
4203     init_hash['offset'],
4204     init_hash['length'],
4205     init_hash['resources'],
4206     init_hash.fetch('form') { "regular" },
4207     init_hash.fetch('operations') { _pcore_type['operations'].value })
4208 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
4196 def self.from_hash(init_hash)
4197   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::ResourceOverrideExpression initializer', _pcore_type.init_hash_type, init_hash))
4198 end
new(locator, offset, length, resources, form = "regular", operations = _pcore_type['operations'].value) click to toggle source
     # File lib/puppet/pops/model/ast.rb
4225 def initialize(locator, offset, length, resources, form = "regular", operations = _pcore_type['operations'].value)
4226   super(locator, offset, length, form)
4227   @hash = @hash ^ resources.hash ^ operations.hash
4228   @resources = resources
4229   @operations = operations
4230 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_all_contents(path, &block) click to toggle source
     # File lib/puppet/pops/model/ast.rb
4244 def _pcore_all_contents(path, &block)
4245   path << self
4246   unless @resources.nil?
4247     block.call(@resources, path)
4248     @resources._pcore_all_contents(path, &block)
4249   end
4250   @operations.each do |value|
4251     block.call(value, path)
4252     value._pcore_all_contents(path, &block)
4253   end
4254   path.pop
4255 end
_pcore_contents() { |resources| ... } click to toggle source
     # File lib/puppet/pops/model/ast.rb
4239 def _pcore_contents
4240   yield(@resources) unless @resources.nil?
4241   @operations.each { |value| yield(value) }
4242 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
4232 def _pcore_init_hash
4233   result = super
4234   result['resources'] = @resources
4235   result['operations'] = @operations unless _pcore_type['operations'].default_value?(@operations)
4236   result
4237 end
eql?(o) click to toggle source
     # File lib/puppet/pops/model/ast.rb
4257 def eql?(o)
4258   super &&
4259   @resources.eql?(o.resources) &&
4260   @operations.eql?(o.operations)
4261 end
Also aliased as: ==