Sha256: 5789e9cc133fa69e1c0e30d5836db3f1cf9432c6522bda7635dc2d2b5387bfbd

Contents?: true

Size: 373 Bytes

Versions: 2

Compression:

Stored size: 373 Bytes

Contents

module RocketAMF
  module Pure
    class ObjectCache < Hash #:nodoc:
      def initialize
        @cache_index    = 0
        @obj_references = []
      end

      def [](obj)
        super(obj.object_id)
      end

      def add_obj(obj)
        @obj_references << obj
        self[obj.object_id] = @cache_index
        @cache_index        += 1
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mrpin-rocketamf-2.0.1 lib/rocketamf/pure/helpers/object_cache.rb
mrpin-rocketamf-2.0.0 lib/rocketamf/pure/helpers/object_cache.rb