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
- #<=>(other) ⇒ Object
- #confidence ⇒ Integer
- #confidence=(value) ⇒ Object
- #confirmed_by ⇒ Array
- #eql?(other) ⇒ Boolean
-
#interesting_entries ⇒ Array
Should be overriden in child classes.
-
#parse_finding_options(opts = {}) ⇒ Object
TODO: Maybe use instance_variable_set ?.
- #references ⇒ Array
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 |
#confidence ⇒ Integer
26 27 28 |
# File 'lib/cms_scanner/finders/finding.rb', line 26 def confidence @confidence ||= 0 end |
#confidence=(value) ⇒ Object
31 32 33 |
# File 'lib/cms_scanner/finders/finding.rb', line 31 def confidence=(value) @confidence = value >= 100 ? 100 : value end |
#confirmed_by ⇒ Array
15 16 17 |
# File 'lib/cms_scanner/finders/finding.rb', line 15 def confirmed_by @confirmed_by ||= [] end |
#eql?(other) ⇒ 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_entries ⇒ Array
Should be overriden in child classes
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 ?
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 |
#references ⇒ Array
10 11 12 |
# File 'lib/cms_scanner/finders/finding.rb', line 10 def references @references ||= [] end |