Class: DeltacloudVM::Client::HardwareProfile

Inherits:
Base
  • Object
show all
Includes:
Helpers
Defined in:
lib/deltacloud_vm/client/models/hardware_profile.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#description, #name, #obj_id, #url

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#client, #connection, convert, #entrypoint, from_collection, #id, #initialize, #original_body, #to_s, #update_instance_variables!, validate_attrs!

Methods included from DeltacloudVM::Client::Helpers::XmlHelper

#extract_xml_body

Methods included from Methods::Api

#api_uri, #current_driver, #current_provider, #feature?, #features, #must_support!, #path, #support?, #supported_collections, #version

Methods included from DeltacloudVM::Client::Helpers::Model

#error, #from_collection, #from_resource, #model

Constructor Details

This class inherits a constructor from DeltacloudVM::Client::Base

Instance Attribute Details

#propertiesObject (readonly)

Returns the value of attribute properties.



21
22
23
# File 'lib/deltacloud_vm/client/models/hardware_profile.rb', line 21

def properties
  @properties
end

Class Method Details

.parse(hwp) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/deltacloud_vm/client/models/hardware_profile.rb', line 23

def self.parse(hwp)
  {
    :properties => hwp.xpath('property').map { |p|
      property_klass(p['kind']).parse(p)
    }
  }
end

Instance Method Details

#architectureObject



39
40
41
# File 'lib/deltacloud_vm/client/models/hardware_profile.rb', line 39

def architecture
  property :architecture
end

#cpuObject



31
32
33
# File 'lib/deltacloud_vm/client/models/hardware_profile.rb', line 31

def cpu
  property :cpu
end

#memoryObject



35
36
37
# File 'lib/deltacloud_vm/client/models/hardware_profile.rb', line 35

def memory
  property :memory
end

#opaque?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/deltacloud_vm/client/models/hardware_profile.rb', line 47

def opaque?
  @properties.empty? && @name == 'opaque'
end

#storageObject



43
44
45
# File 'lib/deltacloud_vm/client/models/hardware_profile.rb', line 43

def storage
  property :storage
end