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
-
#typename ⇒ Object
readonly
Returns the value of attribute typename.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(title, resource_hash, typename) ⇒ TypeShim
constructor
A new instance of TypeShim.
- #name ⇒ Object
- #to_resource ⇒ Object
Constructor Details
#initialize(title, resource_hash, typename) ⇒ TypeShim
7 8 9 10 11 12 13 14 |
# File 'lib/puppet/resource_api/glue.rb', line 7 def initialize(title, resource_hash, typename) # internalize and protect - needs to go deeper @values = resource_hash.dup # "name" is a privileged key @values[:name] = title @typename = typename @values.freeze end |
Instance Attribute Details
#typename ⇒ Object (readonly)
Returns the value of attribute typename.
5 6 7 |
# File 'lib/puppet/resource_api/glue.rb', line 5 def typename @typename end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
5 6 7 |
# File 'lib/puppet/resource_api/glue.rb', line 5 def values @values end |
Instance Method Details
#name ⇒ Object
20 21 22 |
# File 'lib/puppet/resource_api/glue.rb', line 20 def name values[:name] end |
#to_resource ⇒ Object
16 17 18 |
# File 'lib/puppet/resource_api/glue.rb', line 16 def to_resource ResourceShim.new(@values, @typename) end |