Module: ActiveSupport::JSON::Backends::OkJson

Extended by:
OkJson
Included in:
OkJson
Defined in:
lib/active_support/json/backends/okjson.rb

Constant Summary collapse

ParseError =
::ActiveSupport::OkJson::Error

Instance Method Summary collapse

Instance Method Details

#decode(json) ⇒ Object

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



608
609
610
611
612
613
614
615
616
617
618
# File 'lib/active_support/json/backends/okjson.rb', line 608

def decode(json)
  if json.respond_to?(:read)
    json = json.read
  end
  data = ActiveSupport::OkJson.decode(json)
  if ActiveSupport.parse_json_times
    convert_dates_from(data)
  else
    data
  end
end