Permalink
Browse files

Added Warning#=~.

  • Loading branch information...
1 parent 039a41e commit c650a1e1e26d9b50e25965718ab0a22cee30d594 @postmodern committed Jun 24, 2011
Showing with 13 additions and 0 deletions.
  1. +13 −0 lib/warnings/warning.rb
@@ -65,6 +65,19 @@ def source_line
end
#
+ # Compares the warning message to a pattern.
+ #
+ # @param [Regexp] pattern
+ # The pattern to match against.
+ #
+ # @return [Integer, nil]
+ # The index of the pattern match within the warning message.
+ #
+ def =~(pattern)
+ @message =~ message
+ end
+
+ #
# Converts the warning to a String.
#
# @return [String]

0 comments on commit c650a1e

Please sign in to comment.