Class: DiskHandler::Parser
- Inherits:
-
Object
- Object
- DiskHandler::Parser
- Defined in:
- lib/disk_reporter/disk_handler.rb
Instance Attribute Summary collapse
-
#devices ⇒ Object
Returns the value of attribute devices.
Instance Method Summary collapse
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Parser
Returns a new instance of Parser.
129 130 131 132 |
# File 'lib/disk_reporter/disk_handler.rb', line 129 def initialize self.devices = [] populate end |
Instance Attribute Details
#devices ⇒ Object
Returns the value of attribute devices.
128 129 130 |
# File 'lib/disk_reporter/disk_handler.rb', line 128 def devices @devices end |
Instance Method Details
#to_h ⇒ Object
134 135 136 137 138 139 140 |
# File 'lib/disk_reporter/disk_handler.rb', line 134 def to_h disks = [] devices.each do |d| disks << d.to_h end { disks: disks } end |