Class: Fog::Parsers::Compute::VcloudDirector::Metadata
Instance Attribute Summary
Attributes inherited from Base
#response
Instance Method Summary
collapse
#extract_attributes
Methods inherited from Base
#attr_value, #characters, #end_element_namespace, #initialize, #start_element_namespace, #value
Instance Method Details
#end_element(name) ⇒ Object
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/fog/vcloud_director/parsers/compute/metadata.rb', line 50
def end_element(name)
case name
when 'Key'
@key = value
when 'Value'
@val = value
when 'MetadataEntry'
@response[:metadata].merge!(Hash[@key, @val])
end
end
|
#reset ⇒ Object
35
36
37
|
# File 'lib/fog/vcloud_director/parsers/compute/metadata.rb', line 35
def reset
@response = { :metadata => {} }
end
|
#start_element(name, attributes) ⇒ Object
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/fog/vcloud_director/parsers/compute/metadata.rb', line 39
def start_element(name, attributes)
super
case name
when 'Metadata'
metadata = (attributes)
@response[:type] = metadata[:type]
@response[:href] = metadata[:href]
@response[:id] = @response[:href].split('/')[-2]
end
end
|