Class: CanTango::Ability::Cache::BaseCache
- Inherits:
-
Object
- Object
- CanTango::Ability::Cache::BaseCache
- Defined in:
- lib/cantango/ability/cache/base_cache.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ BaseCache
constructor
A new instance of BaseCache.
- #load(key) ⇒ Object
- #save(key, rules) ⇒ Object
Constructor Details
#initialize(name, options = {}) ⇒ BaseCache
Returns a new instance of BaseCache.
7 8 9 10 11 12 13 14 |
# File 'lib/cantango/ability/cache/base_cache.rb', line 7 def initialize name, = {} @name, @options = [name, ] .each_pair do |name, value| var = :"@#{name}" self.instance_variable_set(var, value) end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/cantango/ability/cache/base_cache.rb', line 5 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/cantango/ability/cache/base_cache.rb', line 5 def @options end |
Instance Method Details
#load(key) ⇒ Object
16 17 18 |
# File 'lib/cantango/ability/cache/base_cache.rb', line 16 def load key raise NotImplementedError end |
#save(key, rules) ⇒ Object
20 21 22 |
# File 'lib/cantango/ability/cache/base_cache.rb', line 20 def save key, rules raise NotImplementedError end |