Class: UpdateSoccer::Scraper
- Inherits:
-
Object
- Object
- UpdateSoccer::Scraper
- Defined in:
- lib/update_soccer/scraper.rb
Instance Method Summary collapse
-
#initialize(type) ⇒ Scraper
constructor
A new instance of Scraper.
- #scrape! ⇒ Object
Constructor Details
#initialize(type) ⇒ Scraper
Returns a new instance of Scraper.
3 4 5 |
# File 'lib/update_soccer/scraper.rb', line 3 def initialize(type) @doc = UpdateSoccer::Document.fetch!(type) end |
Instance Method Details
#scrape! ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/update_soccer/scraper.rb', line 6 def scrape! collection = [] links.each do |link| result_extract = extract_data(link) collection << result_extract unless result_extract[:home].nil? end collection end |