Class: Sportradar::Api::Basketball::Ncaamb::Game

Inherits:
Game
  • Object
show all
Defined in:
lib/sportradar/api/basketball/ncaamb/game.rb

Instance Attribute Summary

Attributes inherited from Game

#attendance, #away_id, #broadcast, #changes, #clock, #coverage, #duration, #home_id, #id, #media_timeouts, #period, #player_stats, #response, #scheduled, #score, #status, #team_stats, #title, #venue

Instance Method Summary collapse

Methods inherited from Game

#assign_away, #assign_home, #away, #box, #cancelled?, #changed?, #check_newness, #clock_display, #clock_seconds, #closed?, #completed?, #finished?, #future?, #get_box, #get_pbp, #get_summary, #home, #ingest_box, #ingest_pbp, #ingest_summary, #initialize, #leading_team, #leading_team_id, #not_updated?, #parse_score, #path_base, #path_box, #path_pbp, #path_summary, #pbp, #period_display_long, #periods, #plays, #plays_by_type, #points, #postponed?, #queue_pbp, #queue_summary, #realtime_state, #remember, #scoring, #set_pbp, #started?, #stats, #summary, #team, #tied?, #timeouts, #unnecessary?, #update, #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

Constructor Details

This class inherits a constructor from Sportradar::Api::Basketball::Game

Instance Method Details

#apiObject



36
37
38
# File 'lib/sportradar/api/basketball/ncaamb/game.rb', line 36

def api
  @api ||= Sportradar::Api::Basketball::Ncaamb::Api.new
end

#halftime?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/sportradar/api/basketball/ncaamb/game.rb', line 19

def halftime?
  status == 'halftime' || clock == '00:00' && period == 1
end

#period_classObject



26
27
28
# File 'lib/sportradar/api/basketball/ncaamb/game.rb', line 26

def period_class
  Half
end

#period_displayObject

NCAA MB specific



9
10
11
12
13
14
15
16
17
# File 'lib/sportradar/api/basketball/ncaamb/game.rb', line 9

def period_display
  if period > 3
    "#{period - 2}OT"
  elsif period == 3
    'OT'
  else
    "#{period}H"
  end
end

#period_nameObject



30
31
32
# File 'lib/sportradar/api/basketball/ncaamb/game.rb', line 30

def period_name
  'half'
end

#sim!Object



40
41
42
43
# File 'lib/sportradar/api/basketball/ncaamb/game.rb', line 40

def sim!
  @api = api.sim!
  self
end

#team_classObject



23
24
25
# File 'lib/sportradar/api/basketball/ncaamb/game.rb', line 23

def team_class
  Team
end