Class: AMF::Pure::CacheObjects
- Inherits:
-
Hash
- Object
- Hash
- AMF::Pure::CacheObjects
- Defined in:
- lib/amf/pure/helpers/cache_objects.rb
Overview
:nodoc:
Instance Method Summary collapse
- #[](obj) ⇒ Object
- #add_object(value) ⇒ Object
-
#initialize ⇒ CacheObjects
constructor
A new instance of CacheObjects.
Constructor Details
#initialize ⇒ CacheObjects
Returns a new instance of CacheObjects.
4 5 6 |
# File 'lib/amf/pure/helpers/cache_objects.rb', line 4 def initialize @cache_index = 0 end |
Instance Method Details
#[](obj) ⇒ Object
8 9 10 |
# File 'lib/amf/pure/helpers/cache_objects.rb', line 8 def [](obj) super(obj.object_id) end |
#add_object(value) ⇒ Object
12 13 14 15 |
# File 'lib/amf/pure/helpers/cache_objects.rb', line 12 def add_object(value) self[value.object_id] = @cache_index @cache_index += 1 end |