mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
33 lines
657 B
Ruby
33 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
|