Class: CanTango::Configuration::Engine

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

Instance Method Summary collapse

Methods included from ExecutionModes

#mode=, #modes

Instance Method Details

#off?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/cantango/configuration/engine.rb', line 22

def off?
  !on?
end

#on?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/cantango/configuration/engine.rb', line 18

def on?
  @state == :on
end

#reset!Object



14
15
16
# File 'lib/cantango/configuration/engine.rb', line 14

def reset!
  @state = nil
end

#set(state = :on) ⇒ Object

Raises:

  • (ArgumentError)


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

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