Class: Sportradar::Api::Basketball::FreeThrowMiss

Inherits:
ShotMiss show all
Defined in:
lib/sportradar/api/basketball/plays/free_throw_miss.rb

Instance Attribute Summary

Attributes inherited from ShotMiss

#block, #shot_type, #shot_type_desc

Attributes inherited from Play::Base

#clock, #description, #event_type, #game_seconds, #half, #id, #identifier, #location, #on_court, #on_court_ids, #possession, #quarter, #response, #score, #statistics, #team_id, #updated

Instance Method Summary collapse

Methods inherited from ShotMiss

#parse_statistics

Methods inherited from Play::Base

#==, #clock_seconds, #end_of_ot?, #end_of_period?, #end_of_regulation?, #halftime?, #handle_on_court, #handle_time, #initialize, #media_timeout?, #nba_game_seconds, #parse_statistics, #period, #points, #quarter_break?, #scoring_play?, #timeout?, #update

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::Play::Base

Instance Method Details

#base_keyObject



5
6
7
# File 'lib/sportradar/api/basketball/plays/free_throw_miss.rb', line 5

def base_key
  "freethrow"
end

#display_typeObject



8
9
10
# File 'lib/sportradar/api/basketball/plays/free_throw_miss.rb', line 8

def display_type
  'FT Miss'
end

#free_throw_typeObject



11
12
13
# File 'lib/sportradar/api/basketball/plays/free_throw_miss.rb', line 11

def free_throw_type
  @free_throw_type ||= @statistics.dig(base_key, "free_throw_type")
end

#made?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/sportradar/api/basketball/plays/free_throw_miss.rb', line 14

def made?
  false
end

#player_idObject



17
18
19
20
21
# File 'lib/sportradar/api/basketball/plays/free_throw_miss.rb', line 17

def player_id
  stats = @statistics
  stats = stats[0] if stats.is_a?(Array)
  @player_id ||= stats&.dig("player", "id") # safe operator is specifically for lane violations, which have no player_id and should not be assigned a player
end