Sha256: d1eb7a02a1cf922824931f3b916a03d37e9c3d8aef5148947d4fa89bca27062b

Contents?: true

Size: 685 Bytes

Versions: 19

Compression:

Stored size: 685 Bytes

Contents

module Fog
  module Compute
    class Ovirt

      class Volume < Fog::Model
        attr_accessor :raw
        DISK_SIZE_TO_GB = 1073741824
        identity :id

        attribute :storage_domain
        attribute :size
        attribute :disk_type
        attribute :bootable
        attribute :interface
        attribute :format
        attribute :sparse
        attribute :size_gb

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

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

        def to_s
          id
        end

      end

    end
  end
end

Version data entries

19 entries across 19 versions & 9 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/ovirt/models/compute/volume.rb
fog-nirvanix-1.8.1 lib/fog/ovirt/models/compute/volume.rb
fog-parser-fix-1.6.1 lib/fog/ovirt/models/compute/volume.rb
fog-test-again-1.6.0 lib/fog/ovirt/models/compute/volume.rb
fog-parser-fix-1.6.0 lib/fog/ovirt/models/compute/volume.rb
fog-1.9.0 lib/fog/ovirt/models/compute/volume.rb
fog-maestrodev-1.8.0.20130114204828 lib/fog/ovirt/models/compute/volume.rb
fog-maestrodev-1.8.0.20130111070250 lib/fog/ovirt/models/compute/volume.rb
fog-maestrodev-1.8.0.20130109172219 lib/fog/ovirt/models/compute/volume.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/ovirt/models/compute/volume.rb
fog-sgonyea-1.8.1 lib/fog/ovirt/models/compute/volume.rb
fog-1.8.0 lib/fog/ovirt/models/compute/volume.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/ovirt/models/compute/volume.rb
fog-1.7.0 lib/fog/ovirt/models/compute/volume.rb
fog-1.6.0 lib/fog/ovirt/models/compute/volume.rb
fog-1.5.0 lib/fog/ovirt/models/compute/volume.rb
rackspace-fog-1.4.2 lib/rackspace-fog/ovirt/models/compute/volume.rb
fog-1.4.0 lib/fog/ovirt/models/compute/volume.rb
michiels-fog-1.3.1 lib/fog/ovirt/models/compute/volume.rb