Class: Interlnk::Client::Drive
- Inherits:
-
Object
- Object
- Interlnk::Client::Drive
- Defined in:
- lib/interlnk/client.rb
Instance Attribute Summary collapse
-
#drive_number ⇒ Object
readonly
Returns the value of attribute drive_number.
Instance Method Summary collapse
- #bpb ⇒ Object
- #drive_letter ⇒ Object
-
#initialize(protocol: nil, drive_number: nil) ⇒ Drive
constructor
A new instance of Drive.
- #interio ⇒ Object
- #ready? ⇒ Boolean
- #size ⇒ Object
- #volume_label ⇒ Object
Constructor Details
#initialize(protocol: nil, drive_number: nil) ⇒ Drive
Returns a new instance of Drive.
13 14 15 16 17 |
# File 'lib/interlnk/client.rb', line 13 def initialize(protocol: nil, drive_number: nil) @protocol = protocol @drive_number = drive_number @info = @protocol.get_drive_info(drive_number) end |
Instance Attribute Details
#drive_number ⇒ Object (readonly)
Returns the value of attribute drive_number.
11 12 13 |
# File 'lib/interlnk/client.rb', line 11 def drive_number @drive_number end |
Instance Method Details
#bpb ⇒ Object
32 33 34 |
# File 'lib/interlnk/client.rb', line 32 def bpb @protocol.get_bpb(@drive_number) end |
#drive_letter ⇒ Object
19 20 21 |
# File 'lib/interlnk/client.rb', line 19 def drive_letter (@drive_number + 65).chr end |
#interio ⇒ Object
36 37 38 |
# File 'lib/interlnk/client.rb', line 36 def interio InterIO.new protocol: @protocol, unit_nbr: @drive_number end |
#ready? ⇒ Boolean
40 41 42 43 |
# File 'lib/interlnk/client.rb', line 40 def ready? # TODO: we should probably do a real media check to see if it's ready @info.size != '' end |
#size ⇒ Object
23 24 25 26 |
# File 'lib/interlnk/client.rb', line 23 def size # we return the size in text, since that's how we get it @info.size end |
#volume_label ⇒ Object
28 29 30 |
# File 'lib/interlnk/client.rb', line 28 def volume_label @info.volume_label end |