Skip to content

Commit

Permalink
* golf_prelude.rb (Symbol#call): new method.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Mar 3, 2011
1 parent 4f8f4a9 commit 2adbf72
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions golf_prelude.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.