2009-07-11 16:41:21 -04:00
|
|
|
module Fog
|
|
|
|
module Parsers
|
|
|
|
module AWS
|
|
|
|
module S3
|
|
|
|
|
|
|
|
class GetService < Fog::Parsers::Base
|
|
|
|
|
|
|
|
def reset
|
|
|
|
@bucket = {}
|
2009-07-29 22:50:51 -04:00
|
|
|
@response = { 'Owner' => {}, 'Buckets' => [] }
|
2009-07-11 16:41:21 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def end_element(name)
|
|
|
|
case name
|
|
|
|
when 'Bucket'
|
2009-07-29 22:50:51 -04:00
|
|
|
@response['Buckets'] << @bucket
|
2009-07-11 16:41:21 -04:00
|
|
|
@bucket = {}
|
|
|
|
when 'CreationDate'
|
2009-07-29 22:50:51 -04:00
|
|
|
@bucket['CreationDate'] = Time.parse(@value)
|
|
|
|
when 'DisplayName', 'ID'
|
|
|
|
@response['Owner'][name] = @value
|
2009-07-11 16:41:21 -04:00
|
|
|
when 'Name'
|
2009-07-29 22:50:51 -04:00
|
|
|
@bucket[name] = @value
|
2009-07-11 16:41:21 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|