Class: CanTango::Configuration::Engines::Cache

Inherits:
Engine
  • Object
show all
Defined in:
lib/cantango/configuration/engines/cache.rb

Instance Attribute Summary

Attributes inherited from Engine

#ability

Instance Method Summary collapse

Methods inherited from Engine

#engine_name, #execute!, #initialize

Methods included from Helpers::Debug

#debug

Constructor Details

This class inherits a constructor from CanTango::Engine

Instance Method Details

#compile(state) ⇒ Object



6
7
8
9
# File 'lib/cantango/configuration/engines/cache.rb', line 6

def compile state
  raise "Must be set to :on or :off" if ![:on, :off].include? state
  @compile = state
end

#compile?Boolean

Returns:

  • (Boolean)


11
12
13
14
# File 'lib/cantango/configuration/engines/cache.rb', line 11

def compile?
  @compile ||= :on
  @compile == :on
end

#store {|@store| ... } ⇒ Object

Yields:



16
17
18
19
20
21
22
# File 'lib/cantango/configuration/engines/cache.rb', line 16

def store &block
  @store ||= ns::Store.new
  # CanTango::Ability::Cache::MonetaCache
  @store.default_class ||= CanTango::Ability::Cache::SessionCache
  yield @store if block
  @store
end