Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added :call-seq: to RDoc for some methods #422

Merged
merged 1 commit into from
Jun 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/json/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ class MissingUnicodeSupport < JSONError; end

module_function

# :call-seq:
# JSON.parse(source, opts) -> object
#
# Argument +source+ contains the \String to be parsed. It must be a
# {String-convertible object}[doc/implicit_conversion_rdoc.html#label-String-Convertible+Objects]
# (implementing +to_str+), and must contain valid \JSON data.
Expand Down Expand Up @@ -260,6 +263,9 @@ def parse(source, opts = {})
Parser.new(source, **(opts||{})).parse
end

# :call-seq:
# JSON.parse!(source, opts) -> object
#
# Calls
# parse(source, opts)
# with +source+ and possibly modified +opts+.
Expand All @@ -276,6 +282,9 @@ def parse!(source, opts = {})
Parser.new(source, **(opts||{})).parse
end

# :call-seq:
# JSON.generate(obj, opts = nil) -> new_string
#
# Argument +obj+ is the Ruby object to be converted to \JSON.
#
# Argument +opts+, if given, contains options for the generation, and must be a
Expand Down Expand Up @@ -463,6 +472,9 @@ def fast_generate(obj, opts = nil)
module_function :fast_unparse
# :startdoc:

# :call-seq:
# JSON.pretty_generate(obj, opts = nil) -> new_string
#
# Arguments +obj+ and +opts+ here are the same as
# arguments +obj+ and +opts+ in JSON.generate.
#
Expand Down