Class: RestfulX::AMF::Pure::SerializerCache

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSerializerCache

Returns a new instance of SerializerCache.



34
35
36
# File 'lib/restfulx/amf/pure/serializer.rb', line 34

def initialize
  @cache_index = 0
end

Instance Attribute Details

#cache_indexObject

Returns the value of attribute cache_index.



32
33
34
# File 'lib/restfulx/amf/pure/serializer.rb', line 32

def cache_index
  @cache_index
end

Instance Method Details

#cache(obj) ⇒ Object



38
39
40
41
# File 'lib/restfulx/amf/pure/serializer.rb', line 38

def cache(obj)
  self[obj] = @cache_index
  @cache_index += 1
end