Class: Puppet::ResourceApi::TypeShim
- Inherits:
-
Object
- Object
- Puppet::ResourceApi::TypeShim
- Defined in:
- lib/puppet/resource_api/glue.rb
Overview
A trivial class to provide the functionality required to push data through the existing type/provider parts of puppet
Instance Attribute Summary collapse
-
#attr_def ⇒ Object
readonly
Returns the value of attribute attr_def.
-
#namevars ⇒ Object
readonly
Returns the value of attribute namevars.
-
#typename ⇒ Object
readonly
Returns the value of attribute typename.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(resource_hash, typename, namevars, attr_def) ⇒ TypeShim
constructor
A new instance of TypeShim.
- #name ⇒ Object
- #to_resource ⇒ Object
Constructor Details
#initialize(resource_hash, typename, namevars, attr_def) ⇒ TypeShim
Returns a new instance of TypeShim.
9 10 11 12 13 14 15 16 17 |
# File 'lib/puppet/resource_api/glue.rb', line 9 def initialize(resource_hash, typename, namevars, attr_def) # internalize and protect - needs to go deeper @values = resource_hash.dup.freeze @typename = typename @namevars = namevars @attr_def = attr_def @resource = ResourceShim.new(@values, @typename, @namevars, @attr_def) end |
Instance Attribute Details
#attr_def ⇒ Object (readonly)
Returns the value of attribute attr_def.
7 8 9 |
# File 'lib/puppet/resource_api/glue.rb', line 7 def attr_def @attr_def end |
#namevars ⇒ Object (readonly)
Returns the value of attribute namevars.
7 8 9 |
# File 'lib/puppet/resource_api/glue.rb', line 7 def namevars @namevars end |
#typename ⇒ Object (readonly)
Returns the value of attribute typename.
7 8 9 |
# File 'lib/puppet/resource_api/glue.rb', line 7 def typename @typename end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
7 8 9 |
# File 'lib/puppet/resource_api/glue.rb', line 7 def values @values end |
Instance Method Details
#name ⇒ Object
23 24 25 |
# File 'lib/puppet/resource_api/glue.rb', line 23 def name @resource.title end |
#to_resource ⇒ Object
19 20 21 |
# File 'lib/puppet/resource_api/glue.rb', line 19 def to_resource @resource end |