Class: ProconBypassMan::DeviceModel

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/device_model.rb

Instance Method Summary collapse

Constructor Details

#initialize(device) ⇒ DeviceModel

Returns a new instance of DeviceModel.

Parameters:

  • device (File)


3
4
5
# File 'lib/procon_bypass_man/device_model.rb', line 3

def initialize(device)
  @device = device
end

Instance Method Details

#non_blocking_readString

Returns:

  • (String)

Raises:

  • (IO::EAGAINWaitReadable)


14
15
16
# File 'lib/procon_bypass_man/device_model.rb', line 14

def non_blocking_read
  @device.read_nonblock(64)
end

#send(raw_data) ⇒ Object

Parameters:

  • raw_data (String)


8
9
10
# File 'lib/procon_bypass_man/device_model.rb', line 8

def send(raw_data)
  @device.write_nonblock(raw_data)
end