Class: WarningSigns::RegexPattern
- Inherits:
-
Object
- Object
- WarningSigns::RegexPattern
- Defined in:
- lib/warning_signs/regex_pattern.rb
Instance Attribute Summary collapse
-
#pattern ⇒ Object
Returns the value of attribute pattern.
Instance Method Summary collapse
-
#initialize(raw_pattern) ⇒ RegexPattern
constructor
A new instance of RegexPattern.
- #match?(message) ⇒ Boolean
Constructor Details
#initialize(raw_pattern) ⇒ RegexPattern
Returns a new instance of RegexPattern.
5 6 7 |
# File 'lib/warning_signs/regex_pattern.rb', line 5 def initialize(raw_pattern) @pattern = Regexp.new(raw_pattern[1...-1]) end |
Instance Attribute Details
#pattern ⇒ Object
Returns the value of attribute pattern.
3 4 5 |
# File 'lib/warning_signs/regex_pattern.rb', line 3 def pattern @pattern end |
Instance Method Details
#match?(message) ⇒ Boolean
9 10 11 |
# File 'lib/warning_signs/regex_pattern.rb', line 9 def match?() pattern.match?() end |