Class: MonomeSerial::SerialCommunicator::Communicator

Inherits:
Object
  • Object
show all
Defined in:
lib/monome_serial/serial_communicator/communicator.rb

Direct Known Subclasses

DummyCommunicator, RealCommunicator

Instance Method Summary collapse

Instance Method Details

#readObject



8
9
# File 'lib/monome_serial/serial_communicator/communicator.rb', line 8

def read
end

#real?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/monome_serial/serial_communicator/communicator.rb', line 11

def real?
  raise "please implement me"
end

#write(strings) ⇒ Object

Raises:

  • (ArgumentError)


4
5
6
# File 'lib/monome_serial/serial_communicator/communicator.rb', line 4

def write(strings)
  raise ArgumentError, "The collection of stringified bytes passed into SerialCommunicator#write needs to respond to #[] and #size" unless strings.respond_to?("[]") && strings.respond_to?("size")
end