Skip to content
Browse files

Implement 1.9 features Symbol#length and Symbol#size.

  • Loading branch information...
1 parent ecf8e5f commit 652fd0e89296beb052e340b998011985d65a6e13 @r-stu31 r-stu31 committed Apr 25, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 kernel/common/symbol19.rb
View
6 kernel/common/symbol19.rb
@@ -45,6 +45,12 @@ def empty?
alias_method :intern, :to_sym
alias_method :id2name, :to_s
+ def length
+ to_s.length
+ end
+
+ alias_method :size, :length
+
def match(pattern)
str = to_s

0 comments on commit 652fd0e

Please sign in to comment.
Something went wrong with that request. Please try again.