class Puppet::Pops::Model::AbstractResource

Attributes

form[R]

Public Class Methods

_pcore_type() click to toggle source
     # File lib/puppet/pops/model/ast.rb
3942 def self._pcore_type
3943   @_pcore_type ||= Types::PObjectType.new('Puppet::AST::AbstractResource', {
3944     'parent' => Expression._pcore_type,
3945     'attributes' => {
3946       'form' => {
3947         'type' => Types::PEnumType.new(['exported', 'regular', 'virtual']),
3948         'value' => 'regular'
3949       },
3950       'virtual' => {
3951         'type' => Types::PBooleanType::DEFAULT,
3952         'kind' => 'derived'
3953       },
3954       'exported' => {
3955         'type' => Types::PBooleanType::DEFAULT,
3956         'kind' => 'derived'
3957       }
3958     }
3959   })
3960 end
create(locator, offset, length, form = "regular") click to toggle source
     # File lib/puppet/pops/model/ast.rb
3974 def self.create(locator, offset, length, form = "regular")
3975   ta = Types::TypeAsserter
3976   attrs = _pcore_type.attributes(true)
3977   ta.assert_instance_of('Puppet::AST::Positioned[locator]', attrs['locator'].type, locator)
3978   ta.assert_instance_of('Puppet::AST::Positioned[offset]', attrs['offset'].type, offset)
3979   ta.assert_instance_of('Puppet::AST::Positioned[length]', attrs['length'].type, length)
3980   ta.assert_instance_of('Puppet::AST::AbstractResource[form]', attrs['form'].type, form)
3981   new(locator, offset, length, form)
3982 end
from_asserted_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3966 def self.from_asserted_hash(init_hash)
3967   new(
3968     init_hash['locator'],
3969     init_hash['offset'],
3970     init_hash['length'],
3971     init_hash.fetch('form') { "regular" })
3972 end
from_hash(init_hash) click to toggle source
     # File lib/puppet/pops/model/ast.rb
3962 def self.from_hash(init_hash)
3963   from_asserted_hash(Types::TypeAsserter.assert_instance_of('Puppet::AST::AbstractResource initializer', _pcore_type.init_hash_type, init_hash))
3964 end
new(locator, offset, length, form = "regular") click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned::new
     # File lib/puppet/pops/model/ast.rb
3994 def initialize(locator, offset, length, form = "regular")
3995   super(locator, offset, length)
3996   @hash = @hash ^ form.hash
3997   @form = form
3998 end

Public Instance Methods

==(o)
Alias for: eql?
_pcore_init_hash() click to toggle source
Calls superclass method Puppet::Pops::Model::Positioned#_pcore_init_hash
     # File lib/puppet/pops/model/ast.rb
4000 def _pcore_init_hash
4001   result = super
4002   result['form'] = @form unless @form == "regular"
4003   result
4004 end
eql?(o) click to toggle source
Calls superclass method Puppet::Pops::Model::PopsObject#eql?
     # File lib/puppet/pops/model/ast.rb
4006 def eql?(o)
4007   super &&
4008   @form.eql?(o.form)
4009 end
Also aliased as: ==
exported() click to toggle source
     # File lib/puppet/pops/model/ast.rb
3990 def exported
3991   @form == 'exported'
3992 end
virtual() click to toggle source
     # File lib/puppet/pops/model/ast.rb
3986 def virtual
3987   @form == 'virtual' || @form == 'exported'
3988 end