Skip to content

Commit 3845491

Browse files
committed
Fix examples syntax
1 parent 4ede0a7 commit 3845491

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/json.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@
4545
# Or an alternative way:
4646
#
4747
# require 'json'
48-
# puts {:hello => "goodbye"}.to_json # => "{\"hello\":\"goodbye\"}"
48+
# puts({:hello => "goodbye"}.to_json) # => "{\"hello\":\"goodbye\"}"
4949
#
5050
# <tt>JSON.generate</tt> only allows objects or arrays to be converted
5151
# to JSON syntax. <tt>to_json</tt>, however, accepts many Ruby classes
5252
# even though it acts only as a method for serialization:
5353
#
5454
# require 'json'
5555
#
56-
# 1.to_json => "1"
56+
# 1.to_json # => "1"
5757
#
5858
# The {#generate}[rdoc-ref:JSON#generate] method accepts a variety of options
5959
# to set the formatting of string output and defining what input is accepteable.

0 commit comments

Comments
 (0)