Class: Fog::Parsers::Vcloud::Terremark::Ecloud::GetPublicIps

Inherits:
Base
  • Object
show all
Defined in:
lib/fog/vcloud/terremark/ecloud/parsers/get_public_ips.rb

Instance Attribute Summary

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from Base

#characters, #initialize

Constructor Details

This class inherits a constructor from Fog::Parsers::Base

Instance Method Details

#end_element(name) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/fog/vcloud/terremark/ecloud/parsers/get_public_ips.rb', line 21

def end_element(name)
  case name
  when 'Href'
    @ip_address[name.downcase] = URI.parse(@value)
  when 'Name'
    @ip_address[name.downcase] = @value
  when 'Id'
    @ip_address[name.downcase] = @value.to_i
  when 'PublicIPAddress'
    @response.links << @ip_address
  end
end

#resetObject



9
10
11
# File 'lib/fog/vcloud/terremark/ecloud/parsers/get_public_ips.rb', line 9

def reset
  @response = Struct::TmrkEcloudList.new([])
end

#start_element(name, attributes) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/fog/vcloud/terremark/ecloud/parsers/get_public_ips.rb', line 13

def start_element(name, attributes)
  @value = nil
  case name
  when 'PublicIPAddress'
    @ip_address = Struct::TmrkEcloudPublicIp.new("application/vnd.tmrk.ecloud.publicIp+xml")
  end
end