Class: CanTango::Configuration::Debug

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/cantango/configuration/debug.rb

Overview

Note: This config feature is currently not used, but could potentially be of use in the future

Instance Method Summary collapse

Instance Method Details

#off?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/cantango/configuration/debug.rb', line 16

def off?
  !on?
end

#on?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/cantango/configuration/debug.rb', line 12

def on?
  @state == :on
end

#set(state = :on) ⇒ Object

Raises:

  • (ArgumentError)


7
8
9
10
# File 'lib/cantango/configuration/debug.rb', line 7

def set state = :on
  raise ArgumentError, "Must be :on or :off" unless !state || [:on, :off].include?(state)
  @state = state || :on
end