Class: Aio::Module::InputStyle::Console::Machine

Inherits:
Object
  • Object
show all
Defined in:
lib/modules/input/style/console.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMachine

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

#regsObject

Returns the value of attribute regs.



11
12
13
# File 'lib/modules/input/style/console.rb', line 11

def regs
  @regs
end

#stateObject

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_contextObject



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_stateObject



30
31
32
# File 'lib/modules/input/style/console.rb', line 30

def to_cmd_state
  @state = @cmd_state
end

#to_context_stateObject



34
35
36
# File 'lib/modules/input/style/console.rb', line 34

def to_context_state
  @state = @context_state
end

#to_empty_stateObject



38
39
40
# File 'lib/modules/input/style/console.rb', line 38

def to_empty_state
  @state = @empty_state
end