class Fog::Compute::Vsphere::Volume

Constants

DISK_SIZE_TO_GB

Public Class Methods

new(attributes={} ) click to toggle source
Calls superclass method Fog::Model::new
# File lib/fog/vsphere/models/compute/volume.rb, line 17
def initialize(attributes={} )
  super defaults.merge(attributes)
end

Public Instance Methods

size_gb() click to toggle source
# File lib/fog/vsphere/models/compute/volume.rb, line 21
def size_gb
  attributes[:size_gb] ||= attributes[:size].to_i / DISK_SIZE_TO_GB if attributes[:size]
end
size_gb=(s) click to toggle source
# File lib/fog/vsphere/models/compute/volume.rb, line 25
def size_gb= s
  attributes[:size] = s.to_i * DISK_SIZE_TO_GB if s
end
to_s() click to toggle source
# File lib/fog/vsphere/models/compute/volume.rb, line 29
def to_s
  name
end

Private Instance Methods

defaults() click to toggle source
# File lib/fog/vsphere/models/compute/volume.rb, line 35
def defaults
  {
    :thin=>true,
    :name=>"Hard disk",
    :mode=>"persistent"
  }
end