Class: WhatWeb::Matcher::Text
- Defined in:
- lib/whatweb/matcher/text.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Base
Instance Method Summary collapse
- #compiled_regexp ⇒ Object
-
#initialize(target, match) ⇒ Text
constructor
A new instance of Text.
Methods inherited from Base
#match?, match?, #search_context
Constructor Details
#initialize(target, match) ⇒ Text
Returns a new instance of Text.
7 8 9 10 |
# File 'lib/whatweb/matcher/text.rb', line 7 def initialize(target, match) super(target, match) @text = match[:text].to_s end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'lib/whatweb/matcher/text.rb', line 6 def text @text end |
Instance Method Details
#compiled_regexp ⇒ Object
12 13 14 |
# File 'lib/whatweb/matcher/text.rb', line 12 def compiled_regexp Regexp.new Regexp.escape(text) end |