Class: Puppet::ResourceApi::Transport::ObjectIdCacheAdapter

Inherits:
Pops::Adaptable::Adapter
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeObjectIdCacheAdapter

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

#cacheObject

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