class Sas2ircu::Backplane

Attributes

card[RW]
enclosure[RW]
logical_id[RW]
num_slots[RW]
slots[RW]
start_slot[RW]

Public Class Methods

new(card = nil, enclosure = nil, logical_id = nil, num_slots = nil, start_slot = nil) click to toggle source
# 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

Public Instance Methods

expand_slots() click to toggle source
# File lib/disk_reporter/sas2ircu_parser.rb, line 62
def expand_slots
  (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() click to toggle source
# 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