class NflData::MySportsFeeds::WeeklyPlayerGamelogs

Attributes

client[R]

Public Class Methods

new(client: MySportsFeeds::Client.new) click to toggle source
# File lib/nfl_data/my_sports_feeds/weekly_player_gamelogs.rb, line 8
def initialize(client: MySportsFeeds::Client.new)
  @client = client
end

Public Instance Methods

feed(season_start_year:, week:) click to toggle source
# File lib/nfl_data/my_sports_feeds/weekly_player_gamelogs.rb, line 12
def feed(season_start_year:, week:)
  client.get(endpoint: "#{season_slug(season_start_year)}/week/#{week}/player_gamelogs")["gamelogs"]
end
season_slug(year) click to toggle source
# File lib/nfl_data/my_sports_feeds/weekly_player_gamelogs.rb, line 16
def season_slug(year)
  "#{year}-#{year + 1}-regular"
end