Skip to content

Commit 9171072

Browse files
authored
Merge pull request rails#54964 from viralpraxis/activesupport-json-decoding-tweak-decode-method-description
Tweak `ActiveSupport::JSON.decode` method description
2 parents 0ed3cd4 + 68cb3af commit 9171072

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

activesupport/lib/active_support/json/decoding.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ module JSON
1414
DATETIME_REGEX = /\A(?:\d{4}-\d{2}-\d{2}|\d{4}-\d{1,2}-\d{1,2}[T \t]+\d{1,2}:\d{2}:\d{2}(\.[0-9]*)?(([ \t]*)Z|[-+]\d{2}?(:\d{2})?)?)\z/
1515

1616
class << self
17-
# Parses a JSON string (JavaScript Object Notation) into a hash.
17+
# Parses a JSON string (JavaScript Object Notation) into a Ruby object.
1818
# See http://www.json.org for more info.
1919
#
2020
# ActiveSupport::JSON.decode("{\"team\":\"rails\",\"players\":\"36\"}")
2121
# => {"team" => "rails", "players" => "36"}
22+
# ActiveSupport::JSON.decode("2.39")
23+
# => 2.39
2224
def decode(json, options = {})
2325
data = ::JSON.parse(json, options)
2426

0 commit comments

Comments
 (0)