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/compute/parsers/slicehost/get_backups.rb
2011-01-07 16:52:09 -08:00

32 lines
657 B
Ruby

module Fog
module Parsers
module Slicehost
module Compute
class GetBackups < Fog::Parsers::Base
def reset
@backup = {}
@response = { 'backups' => [] }
end
def end_element(name)
case name
when 'backup'
@response['backups'] << @backup
@backup = {}
when 'date'
@backup[name] = Time.parse(@value)
when 'id', 'slice-id'
@backup[name] = @value.to_i
when 'name'
@backup[name] = @value
end
end
end
end
end
end
end