Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 22 lines (17 sloc) 0.393 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
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
Something went wrong with that request. Please try again.