Class: Interlnk::Client
- Inherits:
-
Object
- Object
- Interlnk::Client
- Defined in:
- lib/interlnk/client.rb
Defined Under Namespace
Classes: Drive, NoSuchDriveException
Instance Method Summary collapse
- #drives ⇒ Object
- #idle ⇒ Object
-
#initialize(transport:, channel:, connection_info: nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(transport:, channel:, connection_info: nil) ⇒ Client
Returns a new instance of Client.
46 47 48 49 50 |
# File 'lib/interlnk/client.rb', line 46 def initialize(transport:, channel:, connection_info: nil) @transport = transport.new(connection_info: connection_info) @channel = channel.new(transport: @transport) @protocol = Protocol.new(channel: @channel) end |
Instance Method Details
#drives ⇒ Object
52 53 54 55 56 57 58 59 60 |
# File 'lib/interlnk/client.rb', line 52 def drives drives = {} @protocol.init_info.drive_map.each do |drive_number| drive = Drive.new(protocol: @protocol, drive_number: drive_number) drives[drive.drive_letter] = drive end drives end |
#idle ⇒ Object
62 63 64 65 66 |
# File 'lib/interlnk/client.rb', line 62 def idle # exchange one set of idle packets # this keeps our connection from timing out @protocol.idle end |