Class: Rustle::DebugPort
- Inherits:
-
Object
- Object
- Rustle::DebugPort
- Defined in:
- lib/rustle/debug_port.rb
Overview
DebugPort
This class’s purpose is simply to provide a mock serial port for debugging purposes. Instead of writing to an actual TTY connection, it simply deserializes and returns the values passed into it. It’s convenient because it allows one to test without requiring a physical Arduino.
Instance Method Summary collapse
-
#write(string) ⇒ Array<Fixnum>
An array containing the deserialized values found in
string
.
Instance Method Details
#write(string) ⇒ Array<Fixnum>
Returns an array containing the deserialized values found in string
.
14 15 16 |
# File 'lib/rustle/debug_port.rb', line 14 def write(string) string.chars.map(&:ord) end |