Displaying 1 result from an estimated 1 matches for "blah_data".
Did you mean:
bl_data
2006 Dec 11
4
creating a cache in rails
...ss (include
Singleton) outside of the controller and that didn''t work either.
Here is the singleton class that I created to cache the information.
Any help would be appreciated. Thanks.
class BlahMemStore
include Singleton
def initialize()
@blah_by_user_id = {}
end
def add(blah_data, user_id)
@blah_by_user_id[user_id] = blah_data
end
def remove(user_id)
@blah_by_user_id[user_id] = nil
end
def find(user_id)
return @blah_by_user_id[user_id]
end
end
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You re...