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 ⇒ Confidence
- #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
47 48 49 |
# File 'lib/cms_scanner/finders/finding.rb', line 47 def <=>(other) to_s.downcase <=> other.to_s.downcase end |
#confidence ⇒ Confidence
28 29 30 |
# File 'lib/cms_scanner/finders/finding.rb', line 28 def confidence @confidence ||= Confidence.new(0) end |
#confidence=(value) ⇒ Object
33 34 35 |
# File 'lib/cms_scanner/finders/finding.rb', line 33 def confidence=(value) @confidence = value.is_a?(Confidence) ? value : Confidence.new(value) end |
#confirmed_by ⇒ Array
17 18 19 |
# File 'lib/cms_scanner/finders/finding.rb', line 17 def confirmed_by @confirmed_by ||= [] end |
#eql?(other) ⇒ Boolean
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
23 24 25 |
# File 'lib/cms_scanner/finders/finding.rb', line 23 def interesting_entries @interesting_entries ||= [] end |
#parse_finding_options(opts = {}) ⇒ Object
TODO: Maybe use instance_variable_set ?
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 |
#references ⇒ Array
12 13 14 |
# File 'lib/cms_scanner/finders/finding.rb', line 12 def references @references ||= [] end |