Class: VCloudSdk::Xml::HardDiskItemWrapper
- Inherits:
-
Item
- Object
- Wrapper
- Item
- VCloudSdk::Xml::HardDiskItemWrapper
show all
- Defined in:
- lib/cloud/vcloud/xml/wrapper_classes/hard_disk_item_wrapper.rb
Instance Method Summary
collapse
Methods inherited from Item
#add_rasd, #edit_link, #get_rasd, #get_rasd_content, #set_rasd
Methods inherited from Wrapper
#==, #[], #[]=, #add_child, #attribute_with_ns, #content, #content=, #create_child, #create_qualified_name, #create_xpath_query, #doc_namespaces, #get_nodes, #href, #name, #to_s, #type, #urn, #xpath
Constructor Details
Returns a new instance of HardDiskItemWrapper.
14
15
16
|
# File 'lib/cloud/vcloud/xml/wrapper_classes/hard_disk_item_wrapper.rb', line 14
def initialize(item)
super(item.node, item.namespace, item.namespace_definitions)
end
|
Instance Method Details
#bus_sub_type ⇒ Object
36
37
38
39
|
# File 'lib/cloud/vcloud/xml/wrapper_classes/hard_disk_item_wrapper.rb', line 36
def bus_sub_type
v = host_resource.attribute_with_ns(HOST_RESOURCE_ATTRIBUTE[:BUS_SUB_TYPE], VCLOUD_NAMESPACE)
v && v.value
end
|
#bus_type ⇒ Object
41
42
43
44
|
# File 'lib/cloud/vcloud/xml/wrapper_classes/hard_disk_item_wrapper.rb', line 41
def bus_type
v = host_resource.attribute_with_ns(HOST_RESOURCE_ATTRIBUTE[:BUS_TYPE], VCLOUD_NAMESPACE)
v && v.value
end
|
#capacity_mb ⇒ Object
18
19
20
21
|
# File 'lib/cloud/vcloud/xml/wrapper_classes/hard_disk_item_wrapper.rb', line 18
def capacity_mb
v = host_resource.attribute_with_ns(HOST_RESOURCE_ATTRIBUTE[:CAPACITY], VCLOUD_NAMESPACE)
v && v.value
end
|
#disk_href ⇒ Object
23
24
25
26
|
# File 'lib/cloud/vcloud/xml/wrapper_classes/hard_disk_item_wrapper.rb', line 23
def disk_href
v = host_resource.attribute_with_ns(HOST_RESOURCE_ATTRIBUTE[:DISK], VCLOUD_NAMESPACE)
v && v.value
end
|
#disk_id ⇒ Object
28
29
30
|
# File 'lib/cloud/vcloud/xml/wrapper_classes/hard_disk_item_wrapper.rb', line 28
def disk_id
get_rasd_content(RASD_TYPES[:ADDRESS_ON_PARENT])
end
|
#eql?(other) ⇒ Boolean
9
10
11
12
|
# File 'lib/cloud/vcloud/xml/wrapper_classes/hard_disk_item_wrapper.rb', line 9
def eql?(other)
disk_id == other.disk_id && instance_id == other.instance_id &&
bus_type == other.bus_type && bus_sub_type == other.bus_sub_type
end
|
#hash ⇒ Object
5
6
7
|
# File 'lib/cloud/vcloud/xml/wrapper_classes/hard_disk_item_wrapper.rb', line 5
def hash
[disk_id, instance_id, bus_type, bus_sub_type].hash
end
|
#host_resource ⇒ Object
50
51
52
|
# File 'lib/cloud/vcloud/xml/wrapper_classes/hard_disk_item_wrapper.rb', line 50
def host_resource
get_rasd(RASD_TYPES[:HOST_RESOURCE])
end
|
#instance_id ⇒ Object
32
33
34
|
# File 'lib/cloud/vcloud/xml/wrapper_classes/hard_disk_item_wrapper.rb', line 32
def instance_id
get_rasd_content(RASD_TYPES[:INSTANCE_ID])
end
|
#parent_instance_id ⇒ Object
46
47
48
|
# File 'lib/cloud/vcloud/xml/wrapper_classes/hard_disk_item_wrapper.rb', line 46
def parent_instance_id
get_rasd_content(RASD_TYPES[:PARENT])
end
|