class AhlScraper::GameListItem

Public Class Methods

new(raw_data) click to toggle source
# File lib/ahl_scraper/resources/game_list_item.rb, line 5
def initialize(raw_data)
  @raw_data = raw_data
end

Public Instance Methods

away_team_city() click to toggle source
# File lib/ahl_scraper/resources/game_list_item.rb, line 25
def away_team_city
  @away_team_city ||= @raw_data[:row][:visiting_team_city]
end
away_team_id() click to toggle source
# File lib/ahl_scraper/resources/game_list_item.rb, line 33
def away_team_id
  @away_team_id ||= @raw_data[:prop][:visiting_team_city][:teamLink].to_i
end
away_team_score() click to toggle source
# File lib/ahl_scraper/resources/game_list_item.rb, line 29
def away_team_score
  @away_team_score ||= @raw_data[:row][:visiting_goal_count].to_i
end
date() click to toggle source
# File lib/ahl_scraper/resources/game_list_item.rb, line 37
def date
  @date ||= @raw_data[:row][:date_with_day]
end
game_center_url() click to toggle source
# File lib/ahl_scraper/resources/game_list_item.rb, line 53
def game_center_url
  @game_center_url ||= "https://theahl.com/stats/game-center/#{id}"
end
game_report_url() click to toggle source
# File lib/ahl_scraper/resources/game_list_item.rb, line 45
def game_report_url
  @game_report_url ||= @raw_data[:prop][:game_report][:link]
end
game_sheet_url() click to toggle source
# File lib/ahl_scraper/resources/game_list_item.rb, line 49
def game_sheet_url
  @game_sheet_url ||= @raw_data[:prop][:game_sheet][:link]
end
home_team_city() click to toggle source
# File lib/ahl_scraper/resources/game_list_item.rb, line 13
def home_team_city
  @home_team_city ||= @raw_data[:row][:home_team_city]
end
home_team_id() click to toggle source
# File lib/ahl_scraper/resources/game_list_item.rb, line 21
def home_team_id
  @home_team_id ||= @raw_data[:prop][:home_team_city][:teamLink].to_i
end
home_team_score() click to toggle source
# File lib/ahl_scraper/resources/game_list_item.rb, line 17
def home_team_score
  @home_team_score ||= @raw_data[:row][:home_goal_count].to_i
end
id() click to toggle source
# File lib/ahl_scraper/resources/game_list_item.rb, line 9
def id
  @id ||= @raw_data[:row][:game_id].to_i
end
status() click to toggle source
# File lib/ahl_scraper/resources/game_list_item.rb, line 41
def status
  @status ||= @raw_data[:row][:game_status]
end