From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 90EFE1BA007E for ; Tue, 9 May 2017 15:36:26 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id B2DAEB5D8D1 for ; Tue, 9 May 2017 16:20:07 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 5E66F18CC80A for ; Tue, 9 May 2017 16:20:08 +0900 (JST) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 86ED8120771; Tue, 9 May 2017 16:20:07 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org 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 076F6120754 for ; Tue, 9 May 2017 16:20:03 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=UJCf13u+c+PKOwe5HQu6S7DqTY4=; b=t+VKehBxXEAEoG6UeE uLq7cvb/Em+7HQrFpGmtHSHyNJAbrTj3wBjiX1P7Kzpeeep9qh7QHlK0a61KKo8A cc3SX8wtP/U6CBIVbTHE2bwJ4DCYeZbD95JJl1VVa/xsa0zXzZuwNMeXWLZEhPWq U9y7rViBqRdrXj9zXm0q70mj8= Received: by filter0091p1las1.sendgrid.net with SMTP id filter0091p1las1-20872-59116D9E-20 2017-05-09 07:19:58.533167056 +0000 UTC Received: from herokuapp.com (ec2-50-19-182-174.compute-1.amazonaws.com [50.19.182.174]) by ismtpd0004p1sjc2.sendgrid.net (SG) with ESMTP id NSqmwJgbTCSWwyxprzE6PA for ; Tue, 09 May 2017 07:19:58.391 +0000 (UTC) Date: Tue, 09 May 2017 07:19:57 +0000 From: matthew@kerwin.net.au To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56080 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13551 X-Redmine-Issue-Author: JustJosh X-Redmine-Sender: phluid61 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: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS7mU/S5Loepuj31Aahm1k+Y9LRTYEvXzvD3Vl w036bDAFq2m6nySlAMlLsEOO9YlVLJXMvDEmAEl/qGf625Q/O0upte4v3luacx+/iW1A1Qt1GkRz6a JOqn3P/eNoHD1DBPPe1QA57rpqvP0yTU9YvWl8GFeeUVwdOI/zqPd9TjVQ== X-ML-Name: ruby-core X-Mail-Count: 81058 Subject: [ruby-core:81058] [Ruby trunk Feature#13551] Add a method to alias class methods 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 #13551 has been updated by phluid61 (Matthew Kerwin). Do you mean singleton methods? Something like this would work: ~~~ruby module Kernel def alias_singleton_method new_name, old_name define_singleton_method(new_name) { old_name } end end ~~~ ~~~ruby class Foo def self.bar :bar end alias_singleton_method :baz, :bar end Foo.bar #=> :bar Foo.baz #=> :bar ~~~ ---------------------------------------- Feature #13551: Add a method to alias class methods https://bugs.ruby-lang.org/issues/13551#change-64704 * Author: JustJosh (Joshua Stowers) * Status: Feedback * Priority: Normal * Assignee: * Target version: ---------------------------------------- There doesn't seem to be an intuitive way to alias class methods. Perhaps we can add a method such as ~~~ ruby alias_class_method :new_name, :old_name ~~~ -- https://bugs.ruby-lang.org/