ruby-changes:18983
From: nobu <ko1@a...>
Date: Fri, 4 Mar 2011 00:30:51 +0900 (JST)
Subject: [ruby-changes:18983] Ruby:r31018 (trunk): * golf_prelude.rb (Symbol#call): new method.
nobu 2011-03-04 00:00:04 +0900 (Fri, 04 Mar 2011) New Revision: 31018 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31018 Log: * golf_prelude.rb (Symbol#call): new method. Modified files: trunk/golf_prelude.rb Index: golf_prelude.rb =================================================================== --- golf_prelude.rb (revision 31017) +++ golf_prelude.rb (revision 31018) @@ -112,3 +112,11 @@ alias old_inspect inspect alias inspect old_to_s end + +class Symbol + def call(*args, &block) + proc do |recv| + recv.__send__(self, *args, &block) + end + end +end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/