Class: Sportradar::Api::Football::Nfl::Game
- Inherits:
-
Game
- Object
- Data
- Game
- Sportradar::Api::Football::Nfl::Game
show all
- Defined in:
- lib/sportradar/api/football/nfl/game.rb
Instance Attribute Summary
Attributes inherited from Game
#attendance, #away_id, #broadcast, #changes, #clock, #coverage, #duration, #home_id, #id, #lineup, #player_stats, #quarter, #response, #scheduled, #score, #status, #team_stats, #title, #type, #venue, #week, #week_number, #year
Instance Method Summary
collapse
Methods inherited from Game
#assign_away, #assign_home, #away, #away_alias, #box, #cancelled?, #changed?, #check_newness, #clock_display, #closed?, #completed?, #current_possession_team_id, #delayed?, #drives, #drives_with_events, #events, #finished?, #future?, #generate_title, #get_box, #get_pbp, #get_statistics, #half_quarters, #halftime?, #home, #home_alias, #ingest_box, #ingest_pbp, #ingest_statistics, #initialize, #leading_team, #leading_team_id, #next_possession_team_id, #not_updated?, #parse_score, #path_box, #path_extended_box, #path_pbp, #path_roster, #path_statistics, #path_summary, #pbp, #period, #plays, #postponed?, #quarter_display, #quarters, #queue_pbp, #queue_statistics, #realtime_state, #remember, #scoring, #sim!, #started?, #stats, #summary_stat, #team, #team_ids, #tied?, #timeouts, #unnecessary?, #update, #update_drives, #update_player_stats, #update_score, #update_stats
Methods inherited from Data
#all_attributes, #attributes, #create_data, #parse_into_array, #parse_into_array_with_options, #parse_out_hashes, #structure_links, #update_data
Instance Method Details
#path_base ⇒ Object
21
22
23
|
# File 'lib/sportradar/api/football/nfl/game.rb', line 21
def path_base
"games/#{ id }"
end
|
#period_class ⇒ Object
28
29
30
|
# File 'lib/sportradar/api/football/nfl/game.rb', line 28
def period_class
Quarter
end
|
#period_key ⇒ Object
32
33
34
|
# File 'lib/sportradar/api/football/nfl/game.rb', line 32
def period_key
'periods'
end
|
#team_class ⇒ Object
25
26
27
|
# File 'lib/sportradar/api/football/nfl/game.rb', line 25
def team_class
Team
end
|
#update_teams(data) ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/sportradar/api/football/nfl/game.rb', line 8
def update_teams(data)
if data['summary']
@home.update(data.dig('summary', 'home'), game: self)
@away.update(data.dig('summary', 'away'), game: self)
else
@home.update(data['home'], api: api, game: self) if data['home'].is_a?(Hash)
@away.update(data['away'], api: api, game: self) if data['away'].is_a?(Hash)
@home_alias = data['home'] if data['home'].is_a?(String) @away_alias = data['away'] if data['away'].is_a?(String) end
end
|