Sha256: 3ad1b5e7ead3aec2c8d0ea863f0ad8bc0745b557d4c12b97ca63b15492656862

Contents?: true

Size: 808 Bytes

Versions: 4

Compression:

Stored size: 808 Bytes

Contents

module Fog
  module Compute
    class Ovirt
      class Volume < Fog::Model
        attr_accessor :raw
        DISK_SIZE_TO_GB = 1_073_741_824
        identity :id

        attribute :storage_domain
        attribute :size
        attribute :disk_type
        attribute :bootable
        attribute :interface
        attribute :format
        attribute :sparse
        attribute :size_gb
        attribute :status
        attribute :quota
        attribute :alias
        attribute :wipe_after_delete

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

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

        def to_s
          id
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-ovirt-1.0.3 lib/fog/ovirt/models/compute/volume.rb
fog-ovirt-1.0.2 lib/fog/ovirt/models/compute/volume.rb
fog-ovirt-1.0.1 lib/fog/ovirt/models/compute/volume.rb
fog-ovirt-1.0.0 lib/fog/ovirt/models/compute/volume.rb