Module: BirdGrinder::Cacheable::Methods
- Defined in:
- lib/bird_grinder/cacheable.rb
Instance Method Summary collapse
-
#cache_get(key) ⇒ Object
Gets the value for the given key from the cache store if the cache store is set.
-
#cache_set(key, value) ⇒ Object
Attempts to set the value for a given key in the current cache_store.
Instance Method Details
#cache_get(key) ⇒ Object
Gets the value for the given key from the cache store if the cache store is set.
47 48 49 50 |
# File 'lib/bird_grinder/cacheable.rb', line 47 def cache_get(key) cs = BirdGrinder.cache_store cs && cs[key.to_s] end |
#cache_set(key, value) ⇒ Object
Attempts to set the value for a given key in the current cache_store.
58 59 60 61 |
# File 'lib/bird_grinder/cacheable.rb', line 58 def cache_set(key, value) cs = BirdGrinder.cache_store cs && cs[key.to_s] = value end |