Class: StateMachine::Quit

Inherits:
Object
  • Object
show all
Defined in:
app/state_machine/quit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(selected_index) ⇒ Quit

Returns a new instance of Quit.



5
6
7
# File 'app/state_machine/quit.rb', line 5

def initialize(selected_index)
  @selected_index = selected_index
end

Instance Attribute Details

#selected_indexObject (readonly)

Returns the value of attribute selected_index.



3
4
5
# File 'app/state_machine/quit.rb', line 3

def selected_index
  @selected_index
end

Instance Method Details

#action(window) ⇒ Object

Raises:



9
10
11
# File 'app/state_machine/quit.rb', line 9

def action(window)
  raise ExitAction.new
end

#next_stateObject



13
14
# File 'app/state_machine/quit.rb', line 13

def next_state
end

#to_sObject



16
17
18
# File 'app/state_machine/quit.rb', line 16

def to_s
  "Exit"
end