Class: Puppet::Pops::Resource::Param

Inherits:
Object
  • Object
show all
Includes:
Types::PuppetObject
Defined in:
lib/puppet/pops/resource/param.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Types::PuppetObject

#_pcore_all_contents, #_pcore_contents, #_pcore_init_hash, #_pcore_type

Constructor Details

#initialize(type, name, name_var = false) ⇒ Param

Returns a new instance of Param.



40
41
42
43
44
# File 'lib/puppet/pops/resource/param.rb', line 40

def initialize(type, name, name_var = false)
  @type = type
  @name = name
  @name_var = name_var
end

Instance Attribute Details

#nameObject (readonly)



36
37
38
# File 'lib/puppet/pops/resource/param.rb', line 36

def name
  @name
end

#name_varObject (readonly)



38
39
40
# File 'lib/puppet/pops/resource/param.rb', line 38

def name_var
  @name_var
end

#typeObject (readonly)



37
38
39
# File 'lib/puppet/pops/resource/param.rb', line 37

def type
  @type
end

Class Method Details

._pcore_typeObject



50
51
52
# File 'lib/puppet/pops/resource/param.rb', line 50

def self._pcore_type
  @ptype
end

.register_ptype(loader, ir) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/puppet/pops/resource/param.rb', line 21

def self.register_ptype(loader, ir)
  @ptype = Pcore::create_object_type(loader, ir, self, 'Puppet::Resource::Param', nil,
    {
      Types::KEY_TYPE => Types::PTypeType::DEFAULT,
      Types::KEY_NAME => Types::PStringType::NON_EMPTY,
      'name_var' => {
        Types::KEY_TYPE => Types::PBooleanType::DEFAULT,
        Types::KEY_VALUE => false
      }
    },
    EMPTY_HASH,
    [Types::KEY_NAME]
  )
end

Instance Method Details

#to_sObject



46
47
48
# File 'lib/puppet/pops/resource/param.rb', line 46

def to_s
  name
end