Class: AhlScraper::TeamGames::DataFetcher
- Inherits:
-
Object
- Object
- AhlScraper::TeamGames::DataFetcher
- Defined in:
- lib/ahl_scraper/fetchers/team_games/data_fetcher.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(team_id, season_id) ⇒ DataFetcher
constructor
A new instance of DataFetcher.
Constructor Details
#initialize(team_id, season_id) ⇒ DataFetcher
Returns a new instance of DataFetcher.
6 7 8 9 |
# File 'lib/ahl_scraper/fetchers/team_games/data_fetcher.rb', line 6 def initialize(team_id, season_id) @team_id = team_id @season_id = season_id end |
Instance Method Details
#call ⇒ Object
11 12 13 |
# File 'lib/ahl_scraper/fetchers/team_games/data_fetcher.rb', line 11 def call JSON.parse(Nokogiri::HTML(URI.parse(url).open).text[5..-2], symbolize_names: true)&.dig(0, :sections, 0, :data) end |