From: hsbt@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:96679] [Ruby master Bug#14160] JSON#generate documentation wrong/misleading
Date: Mon, 06 Jan 2020 06:18:17 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-83663.20200106061817.82018c9f01b8ce7c@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-14160.20171208101238@ruby-lang.org
Issue #14160 has been updated by hsbt (Hiroshi SHIBATA).
Status changed from Assigned to Closed
Applied at https://github.com/ruby/ruby/commit/1658e6b5db0380c39d2423281e10acc5b6c6a8bd
----------------------------------------
Bug #14160: JSON#generate documentation wrong/misleading
https://bugs.ruby-lang.org/issues/14160#change-83663
* Author: StefanPochmann (Stefan Pochmann)
* Status: Closed
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Target version:
* ruby -v:
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
https://docs.ruby-lang.org/en/trunk/JSON.html#module-JSON-label-Generating+JSON
That says `JSON.generate` only allows "objects or arrays", that `to_json` allows more, and uses `1.to_json` as an example for that. But I just tried `JSON.generate(1)` and it works as well. What's up with that?
https://docs.ruby-lang.org/en/trunk/JSON.html#method-i-generate
That talks about `state` a lot. I think it should say `opts`, as that is the argument name, no? Also, it says "state is * a JSON::State object". Note the "*". I think this should be a bullet point, i.e., "a JSON::State object" should be an item in the list following it.
--
https://bugs.ruby-lang.org/
prev parent reply other threads:[~2020-01-06 6:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-14160.20171208101238@ruby-lang.org>
2017-12-08 10:12 ` [ruby-core:84128] [Ruby trunk Bug#14160] JSON#generate documentation wrong/misleading stefan.pochmann
2017-12-08 11:19 ` [ruby-core:84129] " shevegen
2019-08-26 0:25 ` [ruby-core:94552] [Ruby master " merch-redmine
2019-12-29 12:53 ` [ruby-core:96571] " hsbt
2020-01-06 6:18 ` hsbt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-83663.20200106061817.82018c9f01b8ce7c@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).