Class: Puppet::Pops::Adapters::ObjectIdCacheAdapter
- Inherits:
-
Puppet::Pops::Adaptable::Adapter
- Object
- Puppet::Pops::Adaptable::Adapter
- Puppet::Pops::Adapters::ObjectIdCacheAdapter
- Defined in:
- lib/puppet/pops/adapters.rb
Instance Attribute Summary collapse
-
#cache ⇒ Object
Returns the value of attribute cache.
Instance Method Summary collapse
-
#initialize ⇒ ObjectIdCacheAdapter
constructor
A new instance of ObjectIdCacheAdapter.
-
#retrieve(o) ⇒ Object
Retrieves a mutable hash with all stored values.
Methods inherited from Puppet::Pops::Adaptable::Adapter
adapt, adapt_new, associate_adapter, clear, create_adapter, get, instance_var_name, self_attr_name, type_name
Constructor Details
#initialize ⇒ ObjectIdCacheAdapter
Returns a new instance of ObjectIdCacheAdapter.
10 11 12 |
# File 'lib/puppet/pops/adapters.rb', line 10 def initialize @cache = {} end |
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
8 9 10 |
# File 'lib/puppet/pops/adapters.rb', line 8 def cache @cache end |
Instance Method Details
#retrieve(o) ⇒ Object
Retrieves a mutable hash with all stored values
15 16 17 |
# File 'lib/puppet/pops/adapters.rb', line 15 def retrieve(o) @cache[o.__id__] ||= {} end |