Parent

Included Modules

Class/Module Index [+]

Quicksearch

Fog::JSON

Public Class Methods

decode(obj) click to toggle source
# File lib/fog/core/json.rb, line 71
def self.decode(obj)
  Fog::JSON.instance.decode(obj)
end
encode(obj) click to toggle source

Do the MultiJson introspection at this level so we can define our encode/decode methods and perform the introspection only once rather than once per call.

# File lib/fog/core/json.rb, line 67
def self.encode(obj)
  Fog::JSON.instance.encode(obj)
end
sanitize(data) click to toggle source
# File lib/fog/core/json.rb, line 50
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

[Validate]

Generated with the Darkfish Rdoc Generator 2.