Class: Vmstator::DiskStatistics

Inherits:
Object
  • Object
show all
Defined in:
lib/vmstator/linux/disk_statistics.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = false) ⇒ DiskStatistics

Returns a new instance of DiskStatistics.



7
8
9
10
11
12
13
# File 'lib/vmstator/linux/disk_statistics.rb', line 7

def initialize(data=false)
  @disks = []
  if data
    update(data)
  end
  true
end

Instance Attribute Details

#disksObject (readonly)

attrs for each attribute



5
6
7
# File 'lib/vmstator/linux/disk_statistics.rb', line 5

def disks
  @disks
end

Instance Method Details

#update(data) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/vmstator/linux/disk_statistics.rb', line 15

def update(data)
  if data
    @disks << Disk.new(data)
  else
    return false
  end
  true
end