Class: RocketAMF::Pure::SerializerCache::ObjectCache
- Inherits:
-
Hash
- Object
- Hash
- RocketAMF::Pure::SerializerCache::ObjectCache
- Defined in:
- lib/rocketamf/pure/serializer.rb
Overview
:nodoc:
Instance Method Summary (collapse)
- - (Object) [](obj)
- - (Object) add_obj(obj)
-
- (ObjectCache) initialize
constructor
A new instance of ObjectCache.
Constructor Details
- (ObjectCache) initialize
A new instance of ObjectCache
457 458 459 460 |
# File 'lib/rocketamf/pure/serializer.rb', line 457 def initialize @cache_index = 0 @obj_references = [] end |
Instance Method Details
- (Object) [](obj)
462 463 464 |
# File 'lib/rocketamf/pure/serializer.rb', line 462 def [] obj super(obj.object_id) end |
- (Object) add_obj(obj)
466 467 468 469 470 |
# File 'lib/rocketamf/pure/serializer.rb', line 466 def add_obj obj @obj_references << obj self[obj.object_id] = @cache_index @cache_index += 1 end |