Class: AmstradGpt::Interface

Inherits:
Object
  • Object
show all
Defined in:
lib/amstrad_gpt/interface.rb

Instance Method Summary collapse

Constructor Details

#initialize(tty:) ⇒ Interface

Returns a new instance of Interface.



5
6
7
# File 'lib/amstrad_gpt/interface.rb', line 5

def initialize(tty:)
  @tty = tty
end

Instance Method Details

#next_characterObject



15
16
17
# File 'lib/amstrad_gpt/interface.rb', line 15

def next_character
  serial_port.getbyte rescue nil
end

#shutdownObject



9
10
11
# File 'lib/amstrad_gpt/interface.rb', line 9

def shutdown
  serial_port.close
end