Class: Sas2ircu::Disk
- Inherits:
-
Object
- Object
- Sas2ircu::Disk
- Defined in:
- lib/disk_reporter/sas2ircu_parser.rb
Instance Attribute Summary collapse
-
#backplane ⇒ Object
Returns the value of attribute backplane.
Instance Method Summary collapse
- #drive_type ⇒ Object
- #empty? ⇒ Boolean
- #firmware_revision ⇒ Object
- #guid ⇒ Object
-
#initialize(backplane, disk_array = nil) ⇒ Disk
constructor
A new instance of Disk.
- #manufacturer ⇒ Object
- #model_number ⇒ Object
- #protocol ⇒ Object
- #sas_address ⇒ Object
- #serial_no ⇒ Object
- #size_mb ⇒ Object
- #size_sectors ⇒ Object
- #slot ⇒ Object
- #state ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(backplane, disk_array = nil) ⇒ Disk
Returns a new instance of Disk.
80 81 82 83 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 80 def initialize(backplane, disk_array = nil) self.backplane = backplane @array = disk_array end |
Instance Attribute Details
#backplane ⇒ Object
Returns the value of attribute backplane.
79 80 81 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 79 def backplane @backplane end |
Instance Method Details
#drive_type ⇒ Object
133 134 135 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 133 def drive_type @array[12] end |
#empty? ⇒ Boolean
85 86 87 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 85 def empty? @array.nil? end |
#firmware_revision ⇒ Object
117 118 119 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 117 def firmware_revision @array[8] end |
#guid ⇒ Object
125 126 127 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 125 def guid @array[10] end |
#manufacturer ⇒ Object
109 110 111 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 109 def manufacturer @array[6] end |
#model_number ⇒ Object
113 114 115 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 113 def model_number @array[7] end |
#protocol ⇒ Object
129 130 131 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 129 def protocol @array[11] end |
#sas_address ⇒ Object
93 94 95 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 93 def sas_address @array[2] end |
#serial_no ⇒ Object
121 122 123 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 121 def serial_no @array[9] end |
#size_mb ⇒ Object
101 102 103 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 101 def size_mb @array[4] end |
#size_sectors ⇒ Object
105 106 107 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 105 def size_sectors @array[5] end |
#slot ⇒ Object
89 90 91 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 89 def slot @array[1] end |
#state ⇒ Object
97 98 99 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 97 def state @array[3] end |
#to_h ⇒ Object
137 138 139 140 141 142 143 144 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 137 def to_h { slot: slot, state: state, size_mb: size_mb, size_sectors: size_sectors, sas_address: sas_address, manufacturer: manufacturer, model_number: model_number, firmware_revision: firmware_revision, serial_no: serial_no, guid: guid, protocol: protocol, drive_type: drive_type } end |