Class: WhatWeb::Matcher::Text

Inherits:
Base show all
Defined in:
lib/whatweb/matcher/text.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#match, #target

Instance Method Summary collapse

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

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



12
13
14
# File 'lib/whatweb/matcher/text.rb', line 12

def compiled_regexp
  Regexp.new Regexp.escape(text)
end