class Stormy::Caches::MemoryCache
Public Class Methods
new(app)
click to toggle source
Calls superclass method
Stormy::Caches::Base::new
# File lib/stormy/caches/memory_cache.rb, line 3 def initialize(app) super @data = {} end
Protected Instance Methods
build_cache_key(category,key)
click to toggle source
# File lib/stormy/caches/memory_cache.rb, line 10 def build_cache_key(category,key) "#{category}--#{key.gsub("/","--")}" end
get(category,key)
click to toggle source
# File lib/stormy/caches/memory_cache.rb, line 15 def get(category,key) @data[build_cache_key(category,key)] end
put(category,key,value)
click to toggle source
# File lib/stormy/caches/memory_cache.rb, line 20 def put(category,key,value) @data[build_cache_key(category,key)] = value end