Class: Puppet::Pops::Adapters::ObjectIdCacheAdapter

Inherits:
Puppet::Pops::Adaptable::Adapter show all
Defined in:
lib/puppet/pops/adapters.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#initializeObjectIdCacheAdapter

Returns a new instance of ObjectIdCacheAdapter.



9
10
11
# File 'lib/puppet/pops/adapters.rb', line 9

def initialize
  @cache = {}
end

Instance Attribute Details

#cacheObject

Returns the value of attribute cache.



7
8
9
# File 'lib/puppet/pops/adapters.rb', line 7

def cache
  @cache
end

Instance Method Details

#retrieve(o) ⇒ Object

Retrieves a mutable hash with all stored values



14
15
16
# File 'lib/puppet/pops/adapters.rb', line 14

def retrieve(o)
  @cache[o.__id__] ||= {}
end