Class: Puppet::ResourceApi::Transport::ObjectIdCacheAdapter
- Inherits:
-
Pops::Adaptable::Adapter
- Object
- Pops::Adaptable::Adapter
- Puppet::ResourceApi::Transport::ObjectIdCacheAdapter
- Defined in:
- lib/puppet/resource_api/transport.rb
Overview
copy from github.com/puppetlabs/puppet/blob/8cae8a17dbac08d2db0238d5bce2f1e4d1898d65/lib/puppet/pops/adapters.rb#L6-L17 to keep backwards compatibility with puppet4 and 5, which don’t have this yet.
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(obj) ⇒ Object
Retrieves a mutable hash with all stored values.
Constructor Details
#initialize ⇒ ObjectIdCacheAdapter
Returns a new instance of ObjectIdCacheAdapter.
168 169 170 |
# File 'lib/puppet/resource_api/transport.rb', line 168 def initialize @cache = {} end |
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
166 167 168 |
# File 'lib/puppet/resource_api/transport.rb', line 166 def cache @cache end |
Instance Method Details
#retrieve(obj) ⇒ Object
Retrieves a mutable hash with all stored values
173 174 175 |
# File 'lib/puppet/resource_api/transport.rb', line 173 def retrieve(obj) @cache[obj.__id__] ||= {} end |