Class: Matchi::Match
- Inherits:
- BasicObject
- Defined in:
- lib/matchi/match.rb
Overview
**Regular expressions** matcher.
Instance Method Summary collapse
-
#initialize(expected) ⇒ Match
constructor
Initialize the matcher with an instance of Regexp.
-
#matches? ⇒ Boolean
Comparison between actual and expected values.
Constructor Details
#initialize(expected) ⇒ Match
Initialize the matcher with an instance of Regexp.
10 11 12 |
# File 'lib/matchi/match.rb', line 10 def initialize(expected) @expected = expected end |
Instance Method Details
#matches? ⇒ Boolean
Returns Comparison between actual and expected values.
21 22 23 |
# File 'lib/matchi/match.rb', line 21 def matches? @expected.match(yield).nil?.equal?(false) end |