class Rustle::DebugPort

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.

Public Instance Methods

write(string) click to toggle source

@param [String] string the string of chars to be written to the mock

serial port

@return [Array<Fixnum>] an array containing the deserialized values found

in +string+
# File lib/rustle/debug_port.rb, line 14
def write(string)
  string.chars.map(&:ord)
end