Skip to content
Permalink
Browse files

Merge pull request #751 from kachick/implement-symbol-match,casecmp

Implement Symbol#=~, Symbol#match, Symbol#casecmp
  • Loading branch information
alex committed Jun 12, 2013
2 parents 986d1d0 + 067278b commit b28a136f54bdff9cea785537029df1a86bec645a
Showing with 9 additions and 9 deletions.
  1. +9 −0 lib-topaz/symbol.rb
  2. +0 −6 spec/tags/core/symbol/casecmp_tags.txt
  3. +0 −3 spec/tags/core/symbol/match_tags.txt
@@ -27,7 +27,16 @@ def [](*args)
end
alias slice []

def =~(pattern)
self.to_s =~ pattern
end
alias match =~

def swapcase
self.to_s.swapcase.to_sym
end

def casecmp(other)
other.instance_of?(Symbol) ? self.to_s.casecmp(other.to_s) : nil
end
end

This file was deleted.

@@ -1,5 +1,2 @@
fails:Symbol#=~ returns the index of the beginning of the match
fails:Symbol#=~ sets the last match pseudo-variables
fails:Symbol#match returns the index of the beginning of the match
fails:Symbol#match returns nil if there is no match
fails:Symbol#match sets the last match pseudo-variables

0 comments on commit b28a136

Please sign in to comment.
You can’t perform that action at this time.