Class: NflData::MySportsFeeds::WeeklyPlayerGamelogs
- Inherits:
-
Object
- Object
- NflData::MySportsFeeds::WeeklyPlayerGamelogs
- Defined in:
- lib/nfl_data/my_sports_feeds/weekly_player_gamelogs.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #feed(season_start_year:, week:) ⇒ Object
-
#initialize(client: MySportsFeeds::Client.new) ⇒ WeeklyPlayerGamelogs
constructor
A new instance of WeeklyPlayerGamelogs.
- #season_slug(year) ⇒ Object
Constructor Details
#initialize(client: MySportsFeeds::Client.new) ⇒ WeeklyPlayerGamelogs
Returns a new instance of WeeklyPlayerGamelogs.
8 9 10 |
# File 'lib/nfl_data/my_sports_feeds/weekly_player_gamelogs.rb', line 8 def initialize(client: MySportsFeeds::Client.new) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
6 7 8 |
# File 'lib/nfl_data/my_sports_feeds/weekly_player_gamelogs.rb', line 6 def client @client end |
Instance Method Details
#feed(season_start_year:, week:) ⇒ Object
12 13 14 |
# 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) ⇒ Object
16 17 18 |
# File 'lib/nfl_data/my_sports_feeds/weekly_player_gamelogs.rb', line 16 def season_slug(year) "#{year}-#{year + 1}-regular" end |