mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
30 lines
636 B
Ruby
30 lines
636 B
Ruby
module Fog
|
|
module Parsers
|
|
module Terremark
|
|
module Shared
|
|
|
|
class GetPublicIps< Fog::Parsers::Base
|
|
|
|
def reset
|
|
@ip_address = {}
|
|
@response = { 'PublicIpAddresses' => [] }
|
|
end
|
|
|
|
def end_element(name)
|
|
case name
|
|
when 'Href', 'Name'
|
|
@ip_address[name.downcase] = value
|
|
when 'Id'
|
|
@ip_address['id'] = value.to_i
|
|
when 'PublicIPAddress'
|
|
@response['PublicIpAddresses'] << @ip_address
|
|
@ip_address = {}
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|
|
end
|