Module: CMSScanner::Finders::Finding

Defined in:
lib/cms_scanner/finders/finding.rb

Overview

Finding

Constant Summary collapse

FINDING_OPTS =
[:confidence, :confirmed_by, :references, :found_by, :interesting_entries]

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object



45
46
47
# File 'lib/cms_scanner/finders/finding.rb', line 45

def <=>(other)
  to_s.downcase <=> other.to_s.downcase
end

#confidenceInteger

Returns:

  • (Integer)


26
27
28
# File 'lib/cms_scanner/finders/finding.rb', line 26

def confidence
  @confidence ||= 0
end

#confidence=(value) ⇒ Object

Parameters:

  • value (Integer)


31
32
33
# File 'lib/cms_scanner/finders/finding.rb', line 31

def confidence=(value)
  @confidence = value >= 100 ? 100 : value
end

#confirmed_byArray

Returns:

  • (Array)


15
16
17
# File 'lib/cms_scanner/finders/finding.rb', line 15

def confirmed_by
  @confirmed_by ||= []
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/cms_scanner/finders/finding.rb', line 41

def eql?(other)
  self == other && confidence == other.confidence && found_by == other.found_by
end

#interesting_entriesArray

Should be overriden in child classes

Returns:

  • (Array)


21
22
23
# File 'lib/cms_scanner/finders/finding.rb', line 21

def interesting_entries
  @interesting_entries ||= []
end

#parse_finding_options(opts = {}) ⇒ Object

TODO: Maybe use instance_variable_set ?

Parameters:

  • opts (Hash) (defaults to: {})


37
38
39
# File 'lib/cms_scanner/finders/finding.rb', line 37

def parse_finding_options(opts = {})
  FINDING_OPTS.each { |opt| send("#{opt}=", opts[opt]) if opts.key?(opt) }
end

#referencesArray

Returns:

  • (Array)


10
11
12
# File 'lib/cms_scanner/finders/finding.rb', line 10

def references
  @references ||= []
end