Class: Aio::Module::InputStyle::Console::Machine
- Inherits:
-
Object
- Object
- Aio::Module::InputStyle::Console::Machine
- Defined in:
- lib/modules/input/style/console.rb
Instance Attribute Summary collapse
-
#regs ⇒ Object
Returns the value of attribute regs.
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
- #cmd_context ⇒ Object
-
#initialize ⇒ Machine
constructor
A new instance of Machine.
- #parse_line(line) ⇒ Object
- #to_cmd_state ⇒ Object
- #to_context_state ⇒ Object
- #to_empty_state ⇒ Object
Constructor Details
#initialize ⇒ Machine
Returns a new instance of Machine.
13 14 15 16 17 18 19 20 |
# File 'lib/modules/input/style/console.rb', line 13 def initialize @cmd_state = CmdState.new(self) @context_state = ContextState.new(self) @empty_state = EmptyState.new(self) @cmd_context = CmdContext.new @state = @empty_state end |
Instance Attribute Details
#regs ⇒ Object
Returns the value of attribute regs.
11 12 13 |
# File 'lib/modules/input/style/console.rb', line 11 def regs @regs end |
#state ⇒ Object
Returns the value of attribute state.
11 12 13 |
# File 'lib/modules/input/style/console.rb', line 11 def state @state end |
Instance Method Details
#cmd_context ⇒ Object
26 27 28 |
# File 'lib/modules/input/style/console.rb', line 26 def cmd_context @cmd_context end |
#parse_line(line) ⇒ Object
42 43 44 |
# File 'lib/modules/input/style/console.rb', line 42 def parse_line(line) @state.parse_line(line) end |
#to_cmd_state ⇒ Object
30 31 32 |
# File 'lib/modules/input/style/console.rb', line 30 def to_cmd_state @state = @cmd_state end |
#to_context_state ⇒ Object
34 35 36 |
# File 'lib/modules/input/style/console.rb', line 34 def to_context_state @state = @context_state end |
#to_empty_state ⇒ Object
38 39 40 |
# File 'lib/modules/input/style/console.rb', line 38 def to_empty_state @state = @empty_state end |