aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-05-28 03:17:41 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-05-28 03:17:41 -0500
commit21fee1b6540871c0227b97f2312573a4f0d89127 (patch)
tree74a78b80a9dfb427288077c01fec8b6fddd42c6d /activesupport/lib/active_support
parent070fb46295131da50df3048f70acfa7630267efa (diff)
downloadrails-21fee1b6540871c0227b97f2312573a4f0d89127.tar.gz
rails-21fee1b6540871c0227b97f2312573a4f0d89127.tar.bz2
rails-21fee1b6540871c0227b97f2312573a4f0d89127.zip
add ActiveSupport::JSON.decode documentation [ci skip]
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/json/decoding.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/json/decoding.rb b/activesupport/lib/active_support/json/decoding.rb
index 986a764479..72fd97ceee 100644
--- a/activesupport/lib/active_support/json/decoding.rb
+++ b/activesupport/lib/active_support/json/decoding.rb
@@ -8,6 +8,11 @@ module ActiveSupport
module JSON
class << self
+ # Parses a JSON string (JavaScript Object Notation) into a hash.
+ # See www.json.org for more info.
+ #
+ # ActiveSupport::JSON.decode("{\"team\":\"rails\",\"players\":\"36\"}")
+ # => {"team" => "rails", "players" => "36"}
def decode(json, options ={})
data = MultiJson.load(json, options)
if ActiveSupport.parse_json_times