Class: Vmstator::Disk

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = false) ⇒ Disk

Returns a new instance of Disk.



12
13
14
15
16
17
# File 'lib/vmstator/disk.rb', line 12

def initialize(data=false)
  if data
    update(data)
  end
  true
end

Instance Attribute Details

#curObject (readonly)

Returns the value of attribute cur.



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

def cur
  @cur
end

#mergedObject (readonly)

Returns the value of attribute merged.



9
10
11
# File 'lib/vmstator/disk.rb', line 9

def merged
  @merged
end

#msObject (readonly)

Returns the value of attribute ms.



4
5
6
# File 'lib/vmstator/disk.rb', line 4

def ms
  @ms
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/vmstator/disk.rb', line 7

def name
  @name
end

#secObject (readonly)

Returns the value of attribute sec.



6
7
8
# File 'lib/vmstator/disk.rb', line 6

def sec
  @sec
end

#sectorsObject (readonly)

Returns the value of attribute sectors.



10
11
12
# File 'lib/vmstator/disk.rb', line 10

def sectors
  @sectors
end

#totalObject (readonly)

Returns the value of attribute total.



8
9
10
# File 'lib/vmstator/disk.rb', line 8

def total
  @total
end

Instance Method Details

#update(data) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/vmstator/disk.rb', line 19

def update(data)
  if data
    @ms      = data[:ms]      
    @cur     = data[:cur]     
    @sec     = data[:sec]
    @name    = data[:name]
    @total   = data[:total]   
    @merged  = data[:merged]  
    @sectors = data[:sectors] 
  else
    return false
  end
  true
end