mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
20 lines
341 B
Ruby
20 lines
341 B
Ruby
|
module Fog
|
||
|
module JSON
|
||
|
|
||
|
def self.sanitize(data)
|
||
|
case data
|
||
|
when Array
|
||
|
data.map {|datum| sanitize(datum)}
|
||
|
when Hash
|
||
|
for key, value in data
|
||
|
data[key] = sanitize(value)
|
||
|
end
|
||
|
when ::Time
|
||
|
data.strftime("%Y-%m-%dT%H:%M:%SZ")
|
||
|
else
|
||
|
data
|
||
|
end
|
||
|
end
|
||
|
|
||
|
end
|
||
|
end
|