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/slicehost/parsers/compute/get_backups.rb

33 lines
657 B
Ruby
Raw Normal View History

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