Class: Arachni::Parser::Extractors::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/arachni/parser/extractors/base.rb

Overview

This class is abstract.

Author:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



21
22
23
24
25
# File 'lib/arachni/parser/extractors/base.rb', line 21

def initialize( options = {} )
    @html           = options[:html]
    @downcased_html = @html.downcase if @html
    @parser         = options[:parser]
end

Instance Attribute Details

#downcased_htmlObject (readonly)

Returns the value of attribute downcased_html.



19
20
21
# File 'lib/arachni/parser/extractors/base.rb', line 19

def downcased_html
  @downcased_html
end

#htmlObject (readonly)

Returns the value of attribute html.



17
18
19
# File 'lib/arachni/parser/extractors/base.rb', line 17

def html
  @html
end

#parserObject (readonly)

Returns the value of attribute parser.



18
19
20
# File 'lib/arachni/parser/extractors/base.rb', line 18

def parser
  @parser
end

Instance Method Details

#check_for?(string_or_regexp) ⇒ Boolean

Returns:

  • (Boolean)


35
36
37
38
# File 'lib/arachni/parser/extractors/base.rb', line 35

def check_for?( string_or_regexp )
    return true if !@html
    !!@downcased_html[string_or_regexp]
end

#documentObject



40
41
42
# File 'lib/arachni/parser/extractors/base.rb', line 40

def document
    parser.document
end

#runArray<String>

This method is abstract.

This method must be implemented by all checks and must return an array of paths as plain strings

Returns:



32
33
# File 'lib/arachni/parser/extractors/base.rb', line 32

def run
end