Module: CMSScanner::Finders::Finding
- Included in:
- InterestingFinding, User, Version
- Defined in:
- lib/cms_scanner/finders/finding.rb
Overview
Finding
Constant Summary collapse
- FINDING_OPTS =
%i[confidence confirmed_by references found_by interesting_entries].freeze
Class Method Summary collapse
-
.included(base) ⇒ Object
Fix for “Double/Dynamic Inclusion Problem”.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #confidence ⇒ Integer
- #confidence=(value) ⇒ Object
- #confirmed_by ⇒ Array
-
#eql?(other) ⇒ Boolean
TODO: maybe also check for interesting_entries and confirmed_by ? So far this is used in specs only.
-
#interesting_entries ⇒ Array
Should be overriden in child classes.
- #parse_finding_options(opts = {}) ⇒ Object
Class Method Details
.included(base) ⇒ Object
Fix for “Double/Dynamic Inclusion Problem”
6 7 8 9 |
# File 'lib/cms_scanner/finders/finding.rb', line 6 def self.included(base) base.include References super(base) end |
Instance Method Details
#<=>(other) ⇒ Object
47 48 49 |
# File 'lib/cms_scanner/finders/finding.rb', line 47 def <=>(other) to_s.downcase <=> other.to_s.downcase end |
#confidence ⇒ Integer
27 28 29 |
# File 'lib/cms_scanner/finders/finding.rb', line 27 def confidence @confidence ||= 0 end |
#confidence=(value) ⇒ Object
32 33 34 |
# File 'lib/cms_scanner/finders/finding.rb', line 32 def confidence=(value) @confidence = value >= 100 ? 100 : value end |
#confirmed_by ⇒ Array
16 17 18 |
# File 'lib/cms_scanner/finders/finding.rb', line 16 def confirmed_by @confirmed_by ||= [] end |
#eql?(other) ⇒ Boolean
TODO: maybe also check for interesting_entries and confirmed_by ? So far this is used in specs only
43 44 45 |
# File 'lib/cms_scanner/finders/finding.rb', line 43 def eql?(other) self == other && confidence == other.confidence && found_by == other.found_by end |
#interesting_entries ⇒ Array
Should be overriden in child classes
22 23 24 |
# File 'lib/cms_scanner/finders/finding.rb', line 22 def interesting_entries @interesting_entries ||= [] end |
#parse_finding_options(opts = {}) ⇒ Object
37 38 39 |
# File 'lib/cms_scanner/finders/finding.rb', line 37 def (opts = {}) FINDING_OPTS.each { |opt| send("#{opt}=", opts[opt]) if opts.key?(opt) } end |