module ActiveSupport::JSON::Backends::JSONGem

Constants

ParseError

Public Instance Methods

decode(json) click to toggle source

Parses a JSON string or IO and convert it into an object

# File lib/active_support/json/backends/jsongem.rb, line 11
def decode(json)
  if json.respond_to?(:read)
    json = json.read
  end
  data = ::JSON.parse(json)
  if ActiveSupport.parse_json_times
    convert_dates_from(data)
  else
    data
  end
end