Class: Crawlscope::Crawler
- Inherits:
-
Object
- Object
- Crawlscope::Crawler
- Defined in:
- lib/crawlscope/crawler.rb
Instance Method Summary collapse
- #call(urls) ⇒ Object
-
#initialize(page_fetcher:, concurrency:, fetch_executor: :threaded) ⇒ Crawler
constructor
A new instance of Crawler.
Constructor Details
#initialize(page_fetcher:, concurrency:, fetch_executor: :threaded) ⇒ Crawler
Returns a new instance of Crawler.
5 6 7 8 |
# File 'lib/crawlscope/crawler.rb', line 5 def initialize(page_fetcher:, concurrency:, fetch_executor: :threaded) @page_fetcher = page_fetcher @fetch_executor = FetchExecutor.build(name: fetch_executor, concurrency: concurrency) end |
Instance Method Details
#call(urls) ⇒ Object
10 11 12 |
# File 'lib/crawlscope/crawler.rb', line 10 def call(urls) @fetch_executor.call(urls) { |url| fetch(url) } end |