Class: VCloudSdk::VdcStorageProfile
- Inherits:
-
Object
- Object
- VCloudSdk::VdcStorageProfile
- Defined in:
- lib/ruby_vcloud_sdk/vdc_storage_profile.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#available_storage ⇒ Object
Return storageLimitMB - storageUsedMB Return -1 if ‘storageLimitMB’ is 0.
-
#initialize(storage_profile_xml_obj) ⇒ VdcStorageProfile
constructor
A new instance of VdcStorageProfile.
Constructor Details
#initialize(storage_profile_xml_obj) ⇒ VdcStorageProfile
Returns a new instance of VdcStorageProfile.
6 7 8 9 10 11 12 |
# 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 |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/ruby_vcloud_sdk/vdc_storage_profile.rb', line 4 def name @name end |
Instance Method Details
#available_storage ⇒ Object
Return storageLimitMB - storageUsedMB Return -1 if ‘storageLimitMB’ is 0
16 17 18 19 20 |
# 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 |