Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (17 sloc) 393 Bytes
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
Jump to Line
Something went wrong with that request. Please try again.