Class: Scrapbot::Downloader
- Inherits:
-
Object
- Object
- Scrapbot::Downloader
- Defined in:
- lib/scrapbot/downloader.rb
Overview
This class is responsible for downloading page
Instance Attribute Summary collapse
-
#urls ⇒ Object
Returns the value of attribute urls.
Instance Method Summary collapse
-
#initialize(urls) ⇒ Downloader
constructor
A new instance of Downloader.
- #start ⇒ Object
Constructor Details
#initialize(urls) ⇒ Downloader
Returns a new instance of Downloader.
8 9 10 |
# File 'lib/scrapbot/downloader.rb', line 8 def initialize(urls) self.urls = urls end |
Instance Attribute Details
#urls ⇒ Object
Returns the value of attribute urls.
6 7 8 |
# File 'lib/scrapbot/downloader.rb', line 6 def urls @urls end |
Instance Method Details
#start ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/scrapbot/downloader.rb', line 12 def start s = Storage.new urls_list do |response| s.magazine << response end s.save_all end |