Class: CMSScanner::InterestingFinding
- Inherits:
-
Object
- Object
- CMSScanner::InterestingFinding
- Defined in:
- app/models/interesting_finding.rb
Overview
Interesting Finding
Direct Known Subclasses
Instance Attribute Summary collapse
- #to_s ⇒ Object
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #entries ⇒ Array<String>
-
#initialize(url, opts = {}) ⇒ InterestingFinding
constructor
A new instance of InterestingFinding.
Constructor Details
#initialize(url, opts = {}) ⇒ InterestingFinding
Returns a new instance of InterestingFinding.
13 14 15 16 17 18 |
# File 'app/models/interesting_finding.rb', line 13 def initialize(url, opts = {}) @url = url @to_s = opts[:to_s] (opts) end |
Instance Attribute Details
#to_s ⇒ Object
29 30 31 |
# File 'app/models/interesting_finding.rb', line 29 def to_s @to_s || url end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'app/models/interesting_finding.rb', line 6 def url @url end |
Instance Method Details
#==(other) ⇒ Object
33 34 35 36 |
# File 'app/models/interesting_finding.rb', line 33 def ==(other) return false unless self.class == other.class to_s == other.to_s end |
#entries ⇒ Array<String>
21 22 23 24 25 26 27 |
# File 'app/models/interesting_finding.rb', line 21 def entries res = NS::Browser.get(url) return [] unless res && res.headers['Content-Type'] =~ %r{\Atext/plain;}i res.body.split("\n").reject { |s| s.strip.empty? } end |