Class: Fog::Parsers::Terremark::Shared::Network
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
31
32
33
34
35
36
|
# File 'lib/fog/terremark/parsers/shared/network.rb', line 31
def end_element(name)
case name
when "Gateway", "Netmask", "FenceMode"
@response[name.downcase] = value
end
end
|
#reset ⇒ Object
8
9
10
11
12
|
# File 'lib/fog/terremark/parsers/shared/network.rb', line 8
def reset
@response = {
"links" => []
}
end
|
#start_element(name, attributes = []) ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/fog/terremark/parsers/shared/network.rb', line 14
def start_element(name,attributes=[])
super
case name
when "Network"
@response = (attributes)
if @response.has_key?("name")
@response["subnet"] = @response["name"]
end
if @response.has_key?("href")
@response["id"] = @response["href"].split("/").last
end
when "Link"
link = (attributes)
@response["links"] << link
end
end
|