Class: Sas2ircu::Backplane
- Inherits:
-
Object
- Object
- Sas2ircu::Backplane
- Defined in:
- lib/disk_reporter/sas2ircu_parser.rb
Instance Attribute Summary collapse
-
#card ⇒ Object
Returns the value of attribute card.
-
#enclosure ⇒ Object
Returns the value of attribute enclosure.
-
#logical_id ⇒ Object
Returns the value of attribute logical_id.
-
#num_slots ⇒ Object
Returns the value of attribute num_slots.
-
#slots ⇒ Object
Returns the value of attribute slots.
-
#start_slot ⇒ Object
Returns the value of attribute start_slot.
Instance Method Summary collapse
- #expand_slots ⇒ Object
-
#initialize(card = nil, enclosure = nil, logical_id = nil, num_slots = nil, start_slot = nil) ⇒ Backplane
constructor
A new instance of Backplane.
- #to_h ⇒ Object
Constructor Details
#initialize(card = nil, enclosure = nil, logical_id = nil, num_slots = nil, start_slot = nil) ⇒ Backplane
Returns a new instance of Backplane.
53 54 55 56 57 58 59 60 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 53 def initialize(card = nil, enclosure = nil, logical_id = nil, num_slots = nil, start_slot = nil) self.card = card self.enclosure = enclosure, self.logical_id = logical_id self.num_slots = num_slots self.start_slot = start_slot self.slots = {} end |
Instance Attribute Details
#card ⇒ Object
Returns the value of attribute card.
52 53 54 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 52 def card @card end |
#enclosure ⇒ Object
Returns the value of attribute enclosure.
52 53 54 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 52 def enclosure @enclosure end |
#logical_id ⇒ Object
Returns the value of attribute logical_id.
52 53 54 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 52 def logical_id @logical_id end |
#num_slots ⇒ Object
Returns the value of attribute num_slots.
52 53 54 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 52 def num_slots @num_slots end |
#slots ⇒ Object
Returns the value of attribute slots.
52 53 54 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 52 def slots @slots end |
#start_slot ⇒ Object
Returns the value of attribute start_slot.
52 53 54 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 52 def start_slot @start_slot end |
Instance Method Details
#expand_slots ⇒ Object
62 63 64 65 66 67 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 62 def (start_slot..start_slot+num_slots-1).each do |slot_number| self.slots[slot_number] = Disk.new(self) unless slots[slot_number] end self end |
#to_h ⇒ Object
69 70 71 72 73 74 75 |
# File 'lib/disk_reporter/sas2ircu_parser.rb', line 69 def to_h ss = {} slots.each do |_k,s| ss[s.slot] = s.to_h end { enclosure: enclosure, logical_id: logical_id, num_slots: num_slots, start_slot: start_slot, slots: ss } end |