Skip to content
Browse files

* golf_prelude.rb (Symbol#call): new method.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 4f8f4a9 commit 2adbf720d5f5567369bd5b210580969bb751165f @nobu nobu committed Mar 3, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 golf_prelude.rb
View
8 golf_prelude.rb
@@ -112,3 +112,11 @@ def #{meth}(*args, &block)
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

0 comments on commit 2adbf72

Please sign in to comment.
Something went wrong with that request. Please try again.