Class: DNApi::Components::Volume
- Defined in:
- lib/dnapi/components/volume.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#fail_at_percent ⇒ Object
Returns the value of attribute fail_at_percent.
-
#mountpoint ⇒ Object
Returns the value of attribute mountpoint.
-
#size ⇒ Object
Returns the value of attribute size.
-
#warn_at_percent ⇒ Object
Returns the value of attribute warn_at_percent.
Attributes inherited from Struct
Instance Method Summary collapse
Methods inherited from Struct
#==, _many, #_many, #_many_values, _ones, #_ones, #_ones_values, _umembers, belongs_to, from, #initialize, #inspect, many, map, one, #to_hash, #umember_inspect, unserialized_member
Methods included from Test::Ext
#default_fauxture_name, #fixture, #generate, #generate_attributes, #pick
Constructor Details
This class inherits a constructor from DNApi::Struct
Instance Attribute Details
#fail_at_percent ⇒ Object
Returns the value of attribute fail_at_percent
3 4 5 |
# File 'lib/dnapi/components/volume.rb', line 3 def fail_at_percent @fail_at_percent end |
#mountpoint ⇒ Object
Returns the value of attribute mountpoint
3 4 5 |
# File 'lib/dnapi/components/volume.rb', line 3 def mountpoint @mountpoint end |
#size ⇒ Object
Returns the value of attribute size
3 4 5 |
# File 'lib/dnapi/components/volume.rb', line 3 def size @size end |
#warn_at_percent ⇒ Object
Returns the value of attribute warn_at_percent
3 4 5 |
# File 'lib/dnapi/components/volume.rb', line 3 def warn_at_percent @warn_at_percent end |
Instance Method Details
#fail_at ⇒ Object
8 9 10 |
# File 'lib/dnapi/components/volume.rb', line 8 def fail_at (self.size * (self.fail_at_percent.to_f / 100)).to_i end |
#warn_at ⇒ Object
4 5 6 |
# File 'lib/dnapi/components/volume.rb', line 4 def warn_at (self.size * (self.warn_at_percent.to_f / 100)).to_i end |