2010-09-18 13:40:48 -04:00
|
|
|
module Fog
|
|
|
|
module Parsers
|
2011-06-15 17:26:43 -04:00
|
|
|
module Storage
|
|
|
|
module Google
|
2010-09-18 13:40:48 -04:00
|
|
|
|
|
|
|
class GetService < Fog::Parsers::Base
|
|
|
|
|
|
|
|
def reset
|
|
|
|
@bucket = {}
|
|
|
|
@response = { 'Owner' => {}, 'Buckets' => [] }
|
|
|
|
end
|
|
|
|
|
|
|
|
def end_element(name)
|
|
|
|
case name
|
|
|
|
when 'Bucket'
|
|
|
|
@response['Buckets'] << @bucket
|
|
|
|
@bucket = {}
|
|
|
|
when 'CreationDate'
|
2011-05-12 16:15:13 -04:00
|
|
|
@bucket['CreationDate'] = Time.parse(value)
|
2010-09-18 13:40:48 -04:00
|
|
|
when 'DisplayName', 'ID'
|
2011-05-12 16:15:13 -04:00
|
|
|
@response['Owner'][name] = value
|
2010-09-18 13:40:48 -04:00
|
|
|
when 'Name'
|
2011-05-12 16:15:13 -04:00
|
|
|
@bucket[name] = value
|
2010-09-18 13:40:48 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|