Class: Machete::Matchers::RegexpMatcher
- Defined in:
- lib/machete/matchers.rb
Direct Known Subclasses
IndifferentRegexpMatcher, StringRegexpMatcher, SymbolRegexpMatcher
Instance Attribute Summary collapse
-
#regexp ⇒ Object
readonly
Returns the value of attribute regexp.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(regexp) ⇒ RegexpMatcher
constructor
A new instance of RegexpMatcher.
Constructor Details
#initialize(regexp) ⇒ RegexpMatcher
Returns a new instance of RegexpMatcher.
139 140 141 |
# File 'lib/machete/matchers.rb', line 139 def initialize(regexp) @regexp = regexp end |
Instance Attribute Details
#regexp ⇒ Object (readonly)
Returns the value of attribute regexp.
137 138 139 |
# File 'lib/machete/matchers.rb', line 137 def regexp @regexp end |
Instance Method Details
#==(other) ⇒ Object
143 144 145 |
# File 'lib/machete/matchers.rb', line 143 def ==(other) other.instance_of?(self.class) && @regexp == other.regexp end |