Class: NetApp::Volume
- Inherits:
-
Object
- Object
- NetApp::Volume
- Defined in:
- lib/netapp/volume.rb
Instance Attribute Summary collapse
-
#free ⇒ Object
Returns the value of attribute free.
-
#name ⇒ Object
Returns the value of attribute name.
-
#total ⇒ Object
Returns the value of attribute total.
-
#used ⇒ Object
Returns the value of attribute used.
Instance Method Summary collapse
-
#initialize(name, used, free, total) ⇒ Volume
constructor
A new instance of Volume.
- #percentage_used ⇒ Object
Constructor Details
#initialize(name, used, free, total) ⇒ Volume
Returns a new instance of Volume.
5 6 7 8 9 10 |
# File 'lib/netapp/volume.rb', line 5 def initialize(name, used, free, total) @name = name @used = used @free = free @total = total end |
Instance Attribute Details
#free ⇒ Object
Returns the value of attribute free.
3 4 5 |
# File 'lib/netapp/volume.rb', line 3 def free @free end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/netapp/volume.rb', line 3 def name @name end |
#total ⇒ Object
Returns the value of attribute total.
3 4 5 |
# File 'lib/netapp/volume.rb', line 3 def total @total end |
#used ⇒ Object
Returns the value of attribute used.
3 4 5 |
# File 'lib/netapp/volume.rb', line 3 def used @used end |
Instance Method Details
#percentage_used ⇒ Object
12 13 14 |
# File 'lib/netapp/volume.rb', line 12 def percentage_used (@used.to_f / @total.to_f * 100).round(3) end |