Module: CanTango::Configuration::Modes

Included in:
Ability, Engines::Engine
Defined in:
lib/cantango/configuration/modes.rb

Instance Method Summary collapse

Instance Method Details

#mode=(mode_name) ⇒ Object

Raises:

  • (ArgumentException)


8
9
10
11
12
# File 'lib/cantango/configuration/modes.rb', line 8

def mode= mode_name
  mode_name = mode_name.to_sym
  raise ArgumentException, "Not a valid mode name" if !valid_mode_names.include? mode_name
  @modes = (mode_name == :both) ? [:cache, :no_cache] : [mode_name]
end

#modesObject



4
5
6
# File 'lib/cantango/configuration/modes.rb', line 4

def modes
  @modes ||= [:cache, :no_cache]
end