Class: Fog::Compute::Ovirt::Volume

Inherits:
Model
  • Object
show all
Defined in:
lib/rackspace-fog/ovirt/models/compute/volume.rb

Constant Summary collapse

DISK_SIZE_TO_GB =
1073741824

Instance Attribute Summary collapse

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Attribute Details

#rawObject

Returns the value of attribute raw.



6
7
8
# File 'lib/rackspace-fog/ovirt/models/compute/volume.rb', line 6

def raw
  @raw
end

Instance Method Details

#size_gbObject



19
20
21
# File 'lib/rackspace-fog/ovirt/models/compute/volume.rb', line 19

def size_gb
  attributes[:size_gb] ||= attributes[:size].to_i / DISK_SIZE_TO_GB if attributes[:size]
end

#size_gb=(s) ⇒ Object



23
24
25
# File 'lib/rackspace-fog/ovirt/models/compute/volume.rb', line 23

def size_gb= s
  attributes[:size] = s.to_i * DISK_SIZE_TO_GB if s
end

#to_sObject



27
28
29
# File 'lib/rackspace-fog/ovirt/models/compute/volume.rb', line 27

def to_s
  id
end