Class: BandcampDiscover::Scrapers::Base
- Inherits:
-
Object
- Object
- BandcampDiscover::Scrapers::Base
- Defined in:
- lib/bandcamp-discover/scrapers/base.rb
Instance Method Summary collapse
-
#initialize(url:, browser:, max_tasks: 2) ⇒ Base
constructor
A new instance of Base.
- #scrape(force: false) ⇒ Object
Constructor Details
#initialize(url:, browser:, max_tasks: 2) ⇒ Base
Returns a new instance of Base.
10 11 12 13 14 15 |
# File 'lib/bandcamp-discover/scrapers/base.rb', line 10 def initialize(url:, browser:, max_tasks: 2) @url = url @browser = browser @page = browser.new_page @max_tasks = max_tasks end |
Instance Method Details
#scrape(force: false) ⇒ Object
17 18 19 |
# File 'lib/bandcamp-discover/scrapers/base.rb', line 17 def scrape(force: false) guarded { yield @page if block_given? } end |