Class: DiskHandler::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/disk_reporter/disk_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParser

Returns a new instance of Parser.



134
135
136
137
# File 'lib/disk_reporter/disk_handler.rb', line 134

def initialize
  self.devices = []
  populate
end

Instance Attribute Details

#devicesObject

Returns the value of attribute devices.



133
134
135
# File 'lib/disk_reporter/disk_handler.rb', line 133

def devices
  @devices
end

Instance Method Details

#to_hObject



139
140
141
142
143
144
145
# File 'lib/disk_reporter/disk_handler.rb', line 139

def to_h
  disks = []
  devices.each do |d|
    disks << d.to_h
  end
  { disks: disks }
end