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

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

API:

  • private

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ObjectIdCacheAdapter.

API:

  • private



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

def initialize
  @cache = {}
end

Instance Attribute Details

#cacheObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



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

def cache
  @cache
end

Instance Method Details

#retrieve(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Retrieves a mutable hash with all stored values

API:

  • private



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

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