lib/polyfill/v2_4/symbol.rb in polyfill-0.6.0 vs lib/polyfill/v2_4/symbol.rb in polyfill-0.7.0
- old
+ new
@@ -1,9 +1,23 @@
-require_relative 'symbol/instance'
-
module Polyfill
module V2_4
module Symbol
- include Instance
+ def casecmp?(other)
+ return nil unless other.is_a?(::Symbol)
+
+ casecmp(other) == 0
+ end
+
+ def match(*args)
+ if block_given?
+ to_s.match(*args, &::Proc.new)
+ else
+ to_s.match(*args)
+ end
+ end
+
+ def match?(pattern, position = 0)
+ !!(self[position..-1] =~ pattern)
+ end
end
end
end