mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* golf_prelude.rb (Symbol#call): new method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4f8f4a9ee4
commit
2adbf720d5
1 changed files with 8 additions and 0 deletions
|
@ -112,3 +112,11 @@ class Enumerator
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue