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