Class: StateMachine::NewSessionState
- Inherits:
-
Object
- Object
- StateMachine::NewSessionState
- Defined in:
- app/state_machine/new_session_state.rb
Instance Attribute Summary collapse
-
#selected_index ⇒ Object
readonly
Returns the value of attribute selected_index.
Instance Method Summary collapse
- #action(window) ⇒ Object
-
#initialize(selected_index) ⇒ NewSessionState
constructor
A new instance of NewSessionState.
- #next_state ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(selected_index) ⇒ NewSessionState
Returns a new instance of NewSessionState.
5 6 7 |
# File 'app/state_machine/new_session_state.rb', line 5 def initialize(selected_index) @selected_index = selected_index end |
Instance Attribute Details
#selected_index ⇒ Object (readonly)
Returns the value of attribute selected_index.
3 4 5 |
# File 'app/state_machine/new_session_state.rb', line 3 def selected_index @selected_index end |
Instance Method Details
#action(window) ⇒ Object
9 10 11 12 13 14 15 |
# File 'app/state_machine/new_session_state.rb', line 9 def action(window) name = window.getstr name = remove_prohibited_chars(name) commander.new_session(name) end |
#next_state ⇒ Object
17 18 |
# File 'app/state_machine/new_session_state.rb', line 17 def next_state end |
#to_s ⇒ Object
20 21 22 |
# File 'app/state_machine/new_session_state.rb', line 20 def to_s "Creating new session" end |