Class: RocketAMF::Pure::SerializerCache::ObjectCache

Inherits:
Hash
  • Object
show all
Defined in:
lib/rocketamf/pure/serializer.rb

Overview

:nodoc:

Instance Method Summary (collapse)

Constructor Details

- (ObjectCache) initialize



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