Class: NetApp::Volume

Inherits:
Object
  • Object
show all
Defined in:
lib/netapp/volume.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#freeObject

Returns the value of attribute free.



3
4
5
# File 'lib/netapp/volume.rb', line 3

def free
  @free
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/netapp/volume.rb', line 3

def name
  @name
end

#totalObject

Returns the value of attribute total.



3
4
5
# File 'lib/netapp/volume.rb', line 3

def total
  @total
end

#usedObject

Returns the value of attribute used.



3
4
5
# File 'lib/netapp/volume.rb', line 3

def used
  @used
end

Instance Method Details

#percentage_usedObject



12
13
14
# File 'lib/netapp/volume.rb', line 12

def percentage_used
  (@used.to_f / @total.to_f * 100).round(3)
end