mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add Symbol#intern.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
class Symbol
|
||||
include Comparable
|
||||
|
||||
alias intern to_sym
|
||||
|
||||
def to_proc
|
||||
->(obj,*args,&block) do
|
||||
obj.__send__(self, *args, &block)
|
||||
|
||||
@@ -42,3 +42,7 @@ end
|
||||
assert("Symbol#empty?") do
|
||||
assert_true :''.empty?
|
||||
end
|
||||
|
||||
assert('Symbol#intern') do
|
||||
assert_equal :test, :test.intern
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user