Class: Vmstator::Disk
- Inherits:
-
Object
- Object
- Vmstator::Disk
- Defined in:
- lib/vmstator/disk.rb
Instance Attribute Summary collapse
-
#cur ⇒ Object
readonly
Returns the value of attribute cur.
-
#merged ⇒ Object
readonly
Returns the value of attribute merged.
-
#ms ⇒ Object
readonly
Returns the value of attribute ms.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#sec ⇒ Object
readonly
Returns the value of attribute sec.
-
#sectors ⇒ Object
readonly
Returns the value of attribute sectors.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
-
#initialize(data = false) ⇒ Disk
constructor
A new instance of Disk.
- #update(data) ⇒ Object
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
#cur ⇒ Object (readonly)
Returns the value of attribute cur.
5 6 7 |
# File 'lib/vmstator/disk.rb', line 5 def cur @cur end |
#merged ⇒ Object (readonly)
Returns the value of attribute merged.
9 10 11 |
# File 'lib/vmstator/disk.rb', line 9 def merged @merged end |
#ms ⇒ Object (readonly)
Returns the value of attribute ms.
4 5 6 |
# File 'lib/vmstator/disk.rb', line 4 def ms @ms end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/vmstator/disk.rb', line 7 def name @name end |
#sec ⇒ Object (readonly)
Returns the value of attribute sec.
6 7 8 |
# File 'lib/vmstator/disk.rb', line 6 def sec @sec end |
#sectors ⇒ Object (readonly)
Returns the value of attribute sectors.
10 11 12 |
# File 'lib/vmstator/disk.rb', line 10 def sectors @sectors end |
#total ⇒ Object (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 |