1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/vcloud/parsers/get_versions.rb
Edward Muller d48db03314 Refactor Terremark into Vcloud
Purpose is to better abstract individual services
2010-05-10 20:37:03 -07:00

46 lines
1.1 KiB
Ruby

module Fog
module Parsers
module Vcloud
class GetVersions < Fog::Parsers::Base
#
# Based off of:
# http://support.theenterprisecloud.com/kb/default.asp?id=535&Lang=1&SID=
# https://community.vcloudexpress.terremark.com/en-us/product_docs/w/wiki/02-get-versions.aspx
# vCloud API Guide v0.9 - Page 89
#
def reset
@response = []
@supported = false
end
def start_element(name, attributes = {})
@value = ''
case name
when "Version"
@version = Struct::VcloudVersion.new
when "SupportedVersions"
@supported = true
end
end
def end_element(name)
case name
when "Version"
@version.version = @value
@version.supported = @supported
when "LoginUrl"
@version.login_url = @value
when "VersionInfo"
@response << @version
when "SupportedVersions"
@supported = false
end
end
end
end
end
end