Class: CanTango::Ability::Cache::BaseCache

Inherits:
Object
  • Object
show all
Defined in:
lib/cantango/ability/cache/base_cache.rb

Direct Known Subclasses

SessionCache

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = {}
  @name, @options = [name, options]

  options.each_pair do |name, value|
    var = :"@#{name}"
    self.instance_variable_set(var, value)
  end
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/cantango/ability/cache/base_cache.rb', line 5

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/cantango/ability/cache/base_cache.rb', line 5

def options
  @options
end

Instance Method Details

#load(key) ⇒ Object

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/cantango/ability/cache/base_cache.rb', line 16

def load key
  raise NotImplementedError
end

#save(key, rules) ⇒ Object

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/cantango/ability/cache/base_cache.rb', line 20

def save key, rules
  raise NotImplementedError
end