summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-symbol-ext
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-09-20 12:06:53 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-09-20 13:47:29 +0900
commit3a9caad8ebe63dfe2b8583c72fc5e275f13e25c3 (patch)
treea5513bc961165f86c3f7a29ad4fc7b76474ee5b4 /mrbgems/mruby-symbol-ext
parent19d3bb2d90f9806ea6cdef97a139de9f2050363a (diff)
downloadmruby-3a9caad8ebe63dfe2b8583c72fc5e275f13e25c3.tar.gz
mruby-3a9caad8ebe63dfe2b8583c72fc5e275f13e25c3.zip
Move `Symbol#to_proc` to the core from `mruby-symbol-ext` gem.
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.
Diffstat (limited to 'mrbgems/mruby-symbol-ext')
-rw-r--r--mrbgems/mruby-symbol-ext/mrblib/symbol.rb6
-rw-r--r--mrbgems/mruby-symbol-ext/test/symbol.rb4
2 files changed, 0 insertions, 10 deletions
diff --git a/mrbgems/mruby-symbol-ext/mrblib/symbol.rb b/mrbgems/mruby-symbol-ext/mrblib/symbol.rb
index 28cce3156..99fa275d5 100644
--- a/mrbgems/mruby-symbol-ext/mrblib/symbol.rb
+++ b/mrbgems/mruby-symbol-ext/mrblib/symbol.rb
@@ -3,12 +3,6 @@ class Symbol
alias intern to_sym
- def to_proc
- ->(obj,*args,&block) do
- obj.__send__(self, *args, &block)
- end
- end
-
##
# call-seq:
# sym.capitalize -> symbol
diff --git a/mrbgems/mruby-symbol-ext/test/symbol.rb b/mrbgems/mruby-symbol-ext/test/symbol.rb
index 6070d1418..63c1bd826 100644
--- a/mrbgems/mruby-symbol-ext/test/symbol.rb
+++ b/mrbgems/mruby-symbol-ext/test/symbol.rb
@@ -1,10 +1,6 @@
##
# Symbol(Ext) Test
-assert('Symbol#to_proc') do
- assert_equal 5, :abs.to_proc[-5]
-end
-
assert('Symbol.all_symbols') do
foo = [:__symbol_test_1, :__symbol_test_2, :__symbol_test_3].sort
symbols = Symbol.all_symbols.select{|sym|sym.to_s.include? '__symbol_test'}.sort