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

#initializeObjectCache

Returns a new instance of ObjectCache.



371
372
373
# File 'lib/rocketamf/pure/serializer.rb', line 371

def initialize
  @cache_index = 0
end

Instance Method Details

#[](obj) ⇒ Object



375
376
377
# File 'lib/rocketamf/pure/serializer.rb', line 375

def [] obj
  super(obj.object_id)
end

#add_obj(obj) ⇒ Object



379
380
381
382
# File 'lib/rocketamf/pure/serializer.rb', line 379

def add_obj obj
  self[obj.object_id] = @cache_index
  @cache_index += 1
end