class method
self.decode
Ruby on Rails 3.1.12
Since v2.2.3Signature
self.decode(json, options ={})
No documentation comment.
Parameters
-
jsonreq -
optionsopt = {}
Source
# File activesupport/lib/active_support/json/decoding.rb, line 11
def decode(json, options ={})
# Can't reliably detect whether MultiJson responds to load, since it's
# a reserved word. Use adapter as a proxy for new features.
data = if MultiJson.respond_to?(:adapter)
MultiJson.load(json, options)
else
MultiJson.decode(json, options)
end
if ActiveSupport.parse_json_times
convert_dates_from(data)
else
data
end
end
Defined in activesupport/lib/active_support/json/decoding.rb line 11
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::JSON