mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
3a9caad8eb
Even though `Symbol#to_proc` is not included in ISO standard, the `some_method(&:method_name)` is used very widely and convenient. So we moved it to the core.
8 lines
113 B
Ruby
8 lines
113 B
Ruby
class Symbol
|
|
def to_proc
|
|
->(obj,*args,&block) do
|
|
obj.__send__(self, *args, &block)
|
|
end
|
|
end
|
|
end
|