Class: Sportradar::Nfl::PlaySummary
- Inherits:
-
PlayByPlay
- Object
- ApiRequest
- Feeds::LeagueSchedule
- LeagueSchedule
- WeeklySchedule
- GameRequest
- PlayByPlay
- Sportradar::Nfl::PlaySummary
- Defined in:
- lib/sportradar/nfl/play_summary.rb
Instance Method Summary collapse
-
#initialize(year: nil, interval_type: nil, week: 1, away_team_abbreviation: nil, home_team_abbreviation: nil, play_id: nil, details: nil) ⇒ PlaySummary
constructor
A new instance of PlaySummary.
- #path ⇒ Object
Methods inherited from GameRequest
Methods inherited from WeeklySchedule
Methods inherited from LeagueSchedule
Methods inherited from ApiRequest
#client, #endpoint, fetch, #fetch, #league, save, #save
Constructor Details
#initialize(year: nil, interval_type: nil, week: 1, away_team_abbreviation: nil, home_team_abbreviation: nil, play_id: nil, details: nil) ⇒ PlaySummary
Returns a new instance of PlaySummary.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/sportradar/nfl/play_summary.rb', line 4 def initialize(year: nil, interval_type: nil, week: 1, away_team_abbreviation: nil, home_team_abbreviation: nil, play_id: nil, details: nil) super(year: year, interval_type: interval_type, week: week, away_team_abbreviation: away_team_abbreviation, home_team_abbreviation: home_team_abbreviation) @play_id = play_id @details = details raise ArgumentError.new('A play_id or details path is required.') unless play_id || details end |
Instance Method Details
#path ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/sportradar/nfl/play_summary.rb', line 22 def path if details details else "#{game_path}/plays/#{play_id}.json" end end |