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=-2.8 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_PASS shortcircuit=no autolearn=no 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 50A5E1F45F for ; Thu, 9 May 2019 15:16:01 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id C1315120B3F; Fri, 10 May 2019 00:15:55 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id A28221209E0 for ; Fri, 10 May 2019 00:15:53 +0900 (JST) Received: by filter0079p3iad2.sendgrid.net with SMTP id filter0079p3iad2-15218-5CD44429-42 2019-05-09 15:15:53.701574493 +0000 UTC m=+147913.536455665 Received: from herokuapp.com (unknown [54.227.1.136]) by ismtpd0020p1iad2.sendgrid.net (SG) with ESMTP id v5VB47MhSGKeIlqY-m1Egw for ; Thu, 09 May 2019 15:15:53.677 +0000 (UTC) Date: Thu, 09 May 2019 15:15:53 +0000 (UTC) From: tansaku@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 68100 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15409 X-Redmine-Issue-Author: elioncho X-Redmine-Issue-Assignee: marcandre X-Redmine-Sender: tansaku 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?hCaDjkVsqBgJYiFn3age3H=2FWbctQ1EEs1VTj4vMFInRjBFR8vE32eoc+F5YqLb?= =?us-ascii?Q?fdzlLpbNuSCtbdZu2E6HR=2FyensebibcpfJ183oU?= =?us-ascii?Q?TCZCVtW6=2Fwyhzw7F0JF69oa547RfIzX3Xc3SEq9?= =?us-ascii?Q?wwFvhyND4sHU4Sikwim99M63s6jVG1gKnPb=2FwFL?= =?us-ascii?Q?eg51OMiIfp+Z4Tl1D0mNCXRnd5QkNiMOKFg=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92617 Subject: [ruby-core:92617] [Ruby trunk Bug#15409] OpenStruct error when attribute is called 'method' 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15409 has been updated by tansaku (Sam Joseph). I just encountered this issue trying to pop a json structure into an OpenSt= ruct. It would be great if there was a way to indicate to OpenStruct such = that some keywords (e.g. `method`) are safe to be overridden in a particula= r context. ---------------------------------------- Bug #15409: OpenStruct error when attribute is called 'method' https://bugs.ruby-lang.org/issues/15409#change-77976 * Author: elioncho (El=EDas Orozco) * Status: Assigned * Priority: Normal * Assignee: marcandre (Marc-Andre Lafortune) * Target version: = * ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin16] * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- The following error is shown when you try to access an OpenStruct with a pr= operty called method: `method': wrong number of arguments (given 0, expected 1) (ArgumentError) To replicate: ~~~ ruby require 'ostruct' o =3D OpenStruct.new({ method: 'get' }) o.method ~~~ The expected behavior should be to return 'get' -- = https://bugs.ruby-lang.org/ Unsubscribe: