Class: AMF::Pure::SerializerCache::ObjectCache
- Inherits:
-
Hash
- Object
- Hash
- AMF::Pure::SerializerCache::ObjectCache
- Defined in:
- lib/amf/pure/serializer.rb
Overview
:nodoc:
Instance Method Summary collapse
- #[](obj) ⇒ Object
- #add_obj(obj) ⇒ Object
-
#initialize ⇒ ObjectCache
constructor
A new instance of ObjectCache.
Constructor Details
#initialize ⇒ ObjectCache
Returns a new instance of ObjectCache.
312 313 314 |
# File 'lib/amf/pure/serializer.rb', line 312 def initialize @cache_index = 0 end |
Instance Method Details
#[](obj) ⇒ Object
316 317 318 |
# File 'lib/amf/pure/serializer.rb', line 316 def [] obj super(obj.object_id) end |
#add_obj(obj) ⇒ Object
320 321 322 323 |
# File 'lib/amf/pure/serializer.rb', line 320 def add_obj obj self[obj.object_id] = @cache_index @cache_index += 1 end |