instance method
decode
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v3.0.20Available in: v2.3.18 v3.0.20
Signature
decode(json)
Converts a JSON string into a Ruby object.
Parameters
-
jsonreq
Source
# File activesupport/lib/active_support/json/backends/jsongem.rb, line 11
def decode(json)
data = ::JSON.parse(json)
if ActiveSupport.parse_json_times
convert_dates_from(data)
else
data
end
end
Defined in activesupport/lib/active_support/json/backends/jsongem.rb line 11
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::JSON::Backends::JSONGem