Class: DNApi::Components::Volume

Inherits:
Struct
  • Object
show all
Defined in:
lib/dnapi/components/volume.rb

Direct Known Subclasses

EBSVolume, EphemeralVolume

Instance Attribute Summary collapse

Attributes inherited from Struct

#parent

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_percentObject

Returns the value of attribute fail_at_percent

Returns:

  • (Object)

    the current value of fail_at_percent



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

def fail_at_percent
  @fail_at_percent
end

#mountpointObject

Returns the value of attribute mountpoint

Returns:

  • (Object)

    the current value of mountpoint



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

def mountpoint
  @mountpoint
end

#sizeObject

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



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

def size
  @size
end

#warn_at_percentObject

Returns the value of attribute warn_at_percent

Returns:

  • (Object)

    the current value of 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_atObject



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_atObject



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