Class: HttpFind::Matcher
- Inherits:
-
Object
- Object
- HttpFind::Matcher
- Defined in:
- lib/http_find/matcher.rb
Constant Summary collapse
- MATCH_COLOR =
:yellow
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text) ⇒ Matcher
constructor
A new instance of Matcher.
- #match(subj) ⇒ Object
Constructor Details
#initialize(text) ⇒ Matcher
Returns a new instance of Matcher.
10 11 12 |
# File 'lib/http_find/matcher.rb', line 10 def initialize(text) @text = text end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
8 9 10 |
# File 'lib/http_find/matcher.rb', line 8 def text @text end |
Instance Method Details
#match(subj) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/http_find/matcher.rb', line 14 def match(subj) if subj.class == Regexp regexp_match(subj) else string_match(subj.to_s) end end |