Class: NBA::LiveAction
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- NBA::LiveAction
- Defined in:
- lib/nba/live_action.rb
Overview
Represents a live play-by-play action
Instance Attribute Summary collapse
-
#action_number ⇒ Integer
Returns the action number.
-
#action_type ⇒ String
Returns the action type.
-
#clock ⇒ String
Returns the game clock at time of action.
-
#description ⇒ String
Returns the play description.
-
#game_id ⇒ String
Returns the game ID.
-
#is_field_goal ⇒ Integer
Returns whether this is a field goal attempt.
-
#period ⇒ Integer
Returns the period.
-
#period_type ⇒ String
Returns the period type.
-
#player_id ⇒ Integer
Returns the player ID involved in the action.
-
#player_name ⇒ String
Returns the player name.
-
#player_name_i ⇒ String
Returns the player name in abbreviated format.
-
#points_total ⇒ Integer
Returns the points from this action.
-
#qualifier ⇒ Array<String>
Returns any qualifier for the action.
-
#score_away ⇒ String
Returns the away team score after this action.
-
#score_home ⇒ String
Returns the home team score after this action.
-
#shot_distance ⇒ Float
Returns the shot distance.
-
#shot_result ⇒ String
Returns the shot result.
-
#sub_type ⇒ String
Returns the action subtype.
-
#team_id ⇒ Integer
Returns the team ID.
-
#team_tricode ⇒ String
Returns the team tricode.
-
#time_actual ⇒ String
Returns the actual time of the action.
-
#x_legacy ⇒ Float
Returns the x coordinate on the court.
-
#y_legacy ⇒ Float
Returns the y coordinate on the court.
Instance Method Summary collapse
-
#field_goal? ⇒ Boolean
Returns whether this is a field goal attempt.
-
#made? ⇒ Boolean
Returns whether this shot was made.
-
#missed? ⇒ Boolean
Returns whether this shot was missed.
-
#player ⇒ Player?
Returns the player object.
-
#team ⇒ Team?
Returns the team object.
Instance Attribute Details
#action_number ⇒ Integer
Returns the action number
20 |
# File 'lib/nba/live_action.rb', line 20 attribute :action_number, Shale::Type::Integer |
#action_type ⇒ String
Returns the action type
60 |
# File 'lib/nba/live_action.rb', line 60 attribute :action_type, Shale::Type::String |
#clock ⇒ String
Returns the game clock at time of action
28 |
# File 'lib/nba/live_action.rb', line 28 attribute :clock, Shale::Type::String |
#description ⇒ String
Returns the play description
84 |
# File 'lib/nba/live_action.rb', line 84 attribute :description, Shale::Type::String |
#game_id ⇒ String
Returns the game ID
12 |
# File 'lib/nba/live_action.rb', line 12 attribute :game_id, Shale::Type::String |
#is_field_goal ⇒ Integer
Returns whether this is a field goal attempt
180 |
# File 'lib/nba/live_action.rb', line 180 attribute :is_field_goal, Shale::Type::Integer |
#period ⇒ Integer
Returns the period
44 |
# File 'lib/nba/live_action.rb', line 44 attribute :period, Shale::Type::Integer |
#period_type ⇒ String
Returns the period type
52 |
# File 'lib/nba/live_action.rb', line 52 attribute :period_type, Shale::Type::String |
#player_id ⇒ Integer
Returns the player ID involved in the action
92 |
# File 'lib/nba/live_action.rb', line 92 attribute :player_id, Shale::Type::Integer |
#player_name ⇒ String
Returns the player name
100 |
# File 'lib/nba/live_action.rb', line 100 attribute :player_name, Shale::Type::String |
#player_name_i ⇒ String
Returns the player name in abbreviated format
108 |
# File 'lib/nba/live_action.rb', line 108 attribute :player_name_i, Shale::Type::String |
#points_total ⇒ Integer
Returns the points from this action
148 |
# File 'lib/nba/live_action.rb', line 148 attribute :points_total, Shale::Type::Integer |
#qualifier ⇒ Array<String>
Returns any qualifier for the action
76 |
# File 'lib/nba/live_action.rb', line 76 attribute :qualifiers, Shale::Type::String, collection: true |
#score_away ⇒ String
Returns the away team score after this action
140 |
# File 'lib/nba/live_action.rb', line 140 attribute :score_away, Shale::Type::String |
#score_home ⇒ String
Returns the home team score after this action
132 |
# File 'lib/nba/live_action.rb', line 132 attribute :score_home, Shale::Type::String |
#shot_distance ⇒ Float
Returns the shot distance
172 |
# File 'lib/nba/live_action.rb', line 172 attribute :shot_distance, Shale::Type::Float |
#shot_result ⇒ String
Returns the shot result
188 |
# File 'lib/nba/live_action.rb', line 188 attribute :shot_result, Shale::Type::String |
#sub_type ⇒ String
Returns the action subtype
68 |
# File 'lib/nba/live_action.rb', line 68 attribute :sub_type, Shale::Type::String |
#team_id ⇒ Integer
Returns the team ID
116 |
# File 'lib/nba/live_action.rb', line 116 attribute :team_id, Shale::Type::Integer |
#team_tricode ⇒ String
Returns the team tricode
124 |
# File 'lib/nba/live_action.rb', line 124 attribute :team_tricode, Shale::Type::String |
#time_actual ⇒ String
Returns the actual time of the action
36 |
# File 'lib/nba/live_action.rb', line 36 attribute :time_actual, Shale::Type::String |
#x_legacy ⇒ Float
Returns the x coordinate on the court
156 |
# File 'lib/nba/live_action.rb', line 156 attribute :x_legacy, Shale::Type::Float |
#y_legacy ⇒ Float
Returns the y coordinate on the court
164 |
# File 'lib/nba/live_action.rb', line 164 attribute :y_legacy, Shale::Type::Float |
Instance Method Details
#field_goal? ⇒ Boolean
Returns whether this is a field goal attempt
216 217 218 |
# File 'lib/nba/live_action.rb', line 216 def field_goal? is_field_goal.eql?(1) end |
#made? ⇒ Boolean
Returns whether this shot was made
226 227 228 |
# File 'lib/nba/live_action.rb', line 226 def made? shot_result.eql?("Made") end |
#missed? ⇒ Boolean
Returns whether this shot was missed
236 237 238 |
# File 'lib/nba/live_action.rb', line 236 def missed? shot_result.eql?("Missed") end |
#player ⇒ Player?
Returns the player object
196 197 198 |
# File 'lib/nba/live_action.rb', line 196 def player Players.find(player_id) end |
#team ⇒ Team?
Returns the team object
206 207 208 |
# File 'lib/nba/live_action.rb', line 206 def team Teams.find(team_id) end |