Class: Vmstator::Cache
- Inherits:
-
Object
- Object
- Vmstator::Cache
- Defined in:
- lib/vmstator/cache.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#num ⇒ Object
readonly
Returns the value of attribute num.
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
-
#initialize(data = false) ⇒ Cache
constructor
A new instance of Cache.
- #update(data) ⇒ Object
Constructor Details
#initialize(data = false) ⇒ Cache
Returns a new instance of Cache.
10 11 12 13 14 15 |
# File 'lib/vmstator/cache.rb', line 10 def initialize(data=false) if data update(data) end true end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/vmstator/cache.rb', line 5 def name @name end |
#num ⇒ Object (readonly)
Returns the value of attribute num.
4 5 6 |
# File 'lib/vmstator/cache.rb', line 4 def num @num end |
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
8 9 10 |
# File 'lib/vmstator/cache.rb', line 8 def pages @pages end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
6 7 8 |
# File 'lib/vmstator/cache.rb', line 6 def size @size end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
7 8 9 |
# File 'lib/vmstator/cache.rb', line 7 def total @total end |
Instance Method Details
#update(data) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/vmstator/cache.rb', line 17 def update(data) if data @num = data[:num] @name = data[:name] @sec = data[:size] @total = data[:total] @pages = data[:pages] else return false end true end |