Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (20 sloc) 0.508 kB
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
# Inherit from KeyError when Ruby 1.8 compatibility is removed
class IdentityMapKeyError < ::IndexError
end
end
Jump to Line
Something went wrong with that request. Please try again.