Module: CMSScanner::Finders::Finding
- Included in:
- Model::InterestingFinding, Model::User, Model::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”
8 9 10 11 |
# File 'lib/cms_scanner/finders/finding.rb', line 8 def self.included(base) base.include References super(base) end |
Instance Method Details
#<=>(other) ⇒ Object
49 50 51 |
# File 'lib/cms_scanner/finders/finding.rb', line 49 def <=>(other) to_s.downcase <=> other.to_s.downcase end |
#confidence ⇒ Integer
29 30 31 |
# File 'lib/cms_scanner/finders/finding.rb', line 29 def confidence @confidence ||= 0 end |
#confidence=(value) ⇒ Object
34 35 36 |
# File 'lib/cms_scanner/finders/finding.rb', line 34 def confidence=(value) @confidence = value >= 100 ? 100 : value end |
#confirmed_by ⇒ Array
18 19 20 |
# File 'lib/cms_scanner/finders/finding.rb', line 18 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
45 46 47 |
# File 'lib/cms_scanner/finders/finding.rb', line 45 def eql?(other) self == other && confidence == other.confidence && found_by == other.found_by end |
#interesting_entries ⇒ Array
Should be overriden in child classes
24 25 26 |
# File 'lib/cms_scanner/finders/finding.rb', line 24 def interesting_entries @interesting_entries ||= [] end |
#parse_finding_options(opts = {}) ⇒ Object
39 40 41 |
# File 'lib/cms_scanner/finders/finding.rb', line 39 def (opts = {}) FINDING_OPTS.each { |opt| send("#{opt}=", opts[opt]) if opts.key?(opt) } end |