Class: Scrapbot::Downloader

Inherits:
Object
  • Object
show all
Defined in:
lib/scrapbot/downloader.rb

Overview

This class is responsible for downloading page

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#urlsObject

Returns the value of attribute urls.



6
7
8
# File 'lib/scrapbot/downloader.rb', line 6

def urls
  @urls
end

Instance Method Details

#startObject



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