class VCloudSdk::VdcStorageProfile

Attributes

name[R]

Public Class Methods

new(storage_profile_xml_obj) click to toggle source
# File lib/ruby_vcloud_sdk/vdc_storage_profile.rb, line 6
def initialize(storage_profile_xml_obj)
  @storage_profile_xml_obj = storage_profile_xml_obj
  @name = @storage_profile_xml_obj[:name]
  @storage_used_mb = @storage_profile_xml_obj[:storageUsedMB].to_i
  @storage_limit_mb = @storage_profile_xml_obj[:storageLimitMB].to_i
  @vdc_name = @storage_profile_xml_obj[:vdcName]
end

Public Instance Methods

available_storage() click to toggle source

Return storageLimitMB - storageUsedMB Return -1 if ‘storageLimitMB’ is 0

# File lib/ruby_vcloud_sdk/vdc_storage_profile.rb, line 16
def available_storage
  return -1 if @storage_limit_mb == 0

  @storage_limit_mb - @storage_used_mb
end