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=-3.7 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 61DB61F463 for ; Mon, 6 Jan 2020 06:18:27 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id E443212097F; Mon, 6 Jan 2020 15:18:14 +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 51CF812090B for ; Mon, 6 Jan 2020 15:18:13 +0900 (JST) Received: by filterdrecv-p3mdw1-56c97568b5-xjbx9 with SMTP id filterdrecv-p3mdw1-56c97568b5-xjbx9-19-5E12D129-18 2020-01-06 06:18:17.497701605 +0000 UTC m=+1748110.547603482 Received: from herokuapp.com (unknown [54.91.247.56]) by ismtpd0005p1iad1.sendgrid.net (SG) with ESMTP id 9Tl5_1pjRJa-9iW4PkANhw for ; Mon, 06 Jan 2020 06:18:17.440 +0000 (UTC) Date: Mon, 06 Jan 2020 06:18:17 +0000 (UTC) From: hsbt@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72341 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+BmphpEzrVEr2fqVDpB0VofQNbgfqsVvtPdY2vghW0pUSpELEOmWUmsu?= =?us-ascii?Q?IzIDfY0KQa7Ombs3Wf48qX+az+AFui2GqJMwD=2FN?= =?us-ascii?Q?vJkmoSy5ORKhzSdNvso63D0iGAFLVaedb7uIf=2F8?= =?us-ascii?Q?Ms5ctNY39Kxp3oVkOSY5Aqk0bBlJKJ1msppYfd=2F?= =?us-ascii?Q?ChHlDHpU3uf40DysedeeZzCXamRQTGSBmiHZaVS?= =?us-ascii?Q?31tNP9fAm0bibWGx8=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96679 Subject: [ruby-core:96679] [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). 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/