Class: Interlnk::Packet::DriveInfoAnswer

Inherits:
Object
  • Object
show all
Defined in:
lib/interlnk/packet/driveinfo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ DriveInfoAnswer

Returns a new instance of DriveInfoAnswer.



8
9
10
11
12
# File 'lib/interlnk/packet/driveinfo.rb', line 8

def initialize(data)
  (
    @size, @volume_label, @write_protected
  ) = data.unpack('Z10Z12C')
end

Instance Attribute Details

#sizeObject

Returns the value of attribute size.



6
7
8
# File 'lib/interlnk/packet/driveinfo.rb', line 6

def size
  @size
end

#volume_labelObject

Returns the value of attribute volume_label.



6
7
8
# File 'lib/interlnk/packet/driveinfo.rb', line 6

def volume_label
  @volume_label
end

Instance Method Details

#write_protected?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/interlnk/packet/driveinfo.rb', line 14

def write_protected?
  @write_protected != 0
end