Class: HttpFind::Matcher

Inherits:
Object
  • Object
show all
Defined in:
lib/http_find/matcher.rb

Constant Summary collapse

MATCH_COLOR =
:yellow

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#textObject (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