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.



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

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

Instance Attribute Details

#nameObject (readonly)



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

def name
  @name
end

#name_varObject (readonly)



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

def name_var
  @name_var
end

#typeObject (readonly)



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

def type
  @type
end

Class Method Details

._pcore_typeObject



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

def self._pcore_type
  @ptype
end

.register_ptype(loader, ir) ⇒ Object



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

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



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

def to_s
  name
end