From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 11DA51F463 for ; Sun, 29 Dec 2019 12:54:03 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 56CA0120B87; Sun, 29 Dec 2019 21:53:50 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 6155D120B86 for ; Sun, 29 Dec 2019 21:53:47 +0900 (JST) Received: by filterdrecv-p3las1-5bf99c48d-92c98 with SMTP id filterdrecv-p3las1-5bf99c48d-92c98-20-5E08A1DF-22 2019-12-29 12:53:51.602351583 +0000 UTC m=+1080487.573631721 Received: from herokuapp.com (unknown [54.145.162.235]) by ismtpd0052p1iad1.sendgrid.net (SG) with ESMTP id ktkw3iJwQBmN8ACdAikq4g for ; Sun, 29 Dec 2019 12:53:51.457 +0000 (UTC) Date: Sun, 29 Dec 2019 12:53:51 +0000 (UTC) From: hsbt@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72231 X-Redmine-Project: ruby-master X-Redmine-Issue-Id: 14160 X-Redmine-Issue-Author: StefanPochmann X-Redmine-Issue-Assignee: hsbt X-Redmine-Sender: hsbt X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?9+ToIm+BmphpEzrVEr2fqVDpB0VofQNbgfqsVvtPdY37g4zwcG7OKwPEpH2m+4?= =?us-ascii?Q?7JUUfOXTl58x6nJGWl=2Fkd66BDTHxfqw0g65D=2FJn?= =?us-ascii?Q?=2FgzpKhbfFmY4cXyNCnVpmWEv6X19Tecdu8K7LF2?= =?us-ascii?Q?6EPpAYXyf+1VBGHIPtO6asAqPCcvq63ImsXArba?= =?us-ascii?Q?BxSUxHddiODNdfyijb9O+AHDuA2x38wPiKOYW8q?= =?us-ascii?Q?kdYiLUa4LdRhdcX7E=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96571 Subject: [ruby-core:96571] [Ruby master Bug#14160] JSON#generate documentation wrong/misleading X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #14160 has been updated by hsbt (Hiroshi SHIBATA). Assignee set to hsbt (Hiroshi SHIBATA) Status changed from Open to Assigned Tags set to doc ---------------------------------------- Bug #14160: JSON#generate documentation wrong/misleading https://bugs.ruby-lang.org/issues/14160#change-83529 * Author: StefanPochmann (Stefan Pochmann) * Status: Assigned * 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/