Class: CanTango::Ability::Cache::MonetaCache
- Inherits:
-
Object
- Object
- CanTango::Ability::Cache::MonetaCache
- Defined in:
- lib/cantango/ability/cache/moneta_cache.rb
Instance Attribute Summary collapse
-
#store ⇒ Object
readonly
one cache store is shared for all store instances (w different names).
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ MonetaCache
constructor
for a YamlStore, the name is the name of the yml file.
- #invalidate!(key) ⇒ Object
- #load(key) ⇒ Object
- #save(key, rules) ⇒ Object
Constructor Details
#initialize(name, options = {}) ⇒ MonetaCache
for a YamlStore, the name is the name of the yml file
12 13 14 15 16 |
# File 'lib/cantango/ability/cache/moneta_cache.rb', line 12 def initialize name, = {} super @store = CanTango::Cache::MonetaCache.instance @store.configure_with end |
Instance Attribute Details
#store ⇒ Object (readonly)
one cache store is shared for all store instances (w different names)
9 10 11 |
# File 'lib/cantango/ability/cache/moneta_cache.rb', line 9 def store @store end |
Instance Method Details
#invalidate!(key) ⇒ Object
26 27 28 |
# File 'lib/cantango/ability/cache/moneta_cache.rb', line 26 def invalidate! key store.delete key end |
#load(key) ⇒ Object
18 19 20 |
# File 'lib/cantango/ability/cache/moneta_cache.rb', line 18 def load key store.load! key end |
#save(key, rules) ⇒ Object
22 23 24 |
# File 'lib/cantango/ability/cache/moneta_cache.rb', line 22 def save key, rules store.save! key, rules end |