Sha256: 9c0b9d021dcc44d6aa08b81c50c893b7026ab03dfdedec3b4a7ba672a69f9d76

Contents?: true

Size: 393 Bytes

Versions: 18

Compression:

Stored size: 393 Bytes

Contents

module Twitter

  # Tracks objects to help ensure that each object gets loaded only once.
  # See: http://www.martinfowler.com/eaaCatalog/identityMap.html
  class IdentityMap < Hash

    # @param id
    # @return [Object]
    def fetch(id)
      self[id]
    end

    # @param id
    # @param object
    # @return [Object]
    def store(id, object)
      self[id] = object
    end

  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
twitter-4.8.1 lib/twitter/identity_map.rb
twitter-4.8.0 lib/twitter/identity_map.rb
twitter-4.7.0 lib/twitter/identity_map.rb
twitter-4.6.2 lib/twitter/identity_map.rb
twitter-4.6.1 lib/twitter/identity_map.rb
twitter-4.6.0 lib/twitter/identity_map.rb
twitter-4.5.0 lib/twitter/identity_map.rb
twitter-4.4.4 lib/twitter/identity_map.rb
twitter-4.4.3 lib/twitter/identity_map.rb
twitter-4.4.2 lib/twitter/identity_map.rb
twitter-4.4.1 lib/twitter/identity_map.rb
twitter-4.4.0 lib/twitter/identity_map.rb
twitter-4.3.0 lib/twitter/identity_map.rb
twitter-4.2.0 lib/twitter/identity_map.rb
twitter-4.1.2 lib/twitter/identity_map.rb
twitter-4.1.1 lib/twitter/identity_map.rb
twitter-4.1.0 lib/twitter/identity_map.rb
twitter-4.0.0 lib/twitter/identity_map.rb