Class: NBA::Play
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- NBA::Play
- Defined in:
- lib/nba/play.rb
Overview
Represents a single play in a game’s play-by-play data
Instance Attribute Summary collapse
-
#event_msg_action_type ⇒ Integer
Returns the event message action type.
-
#event_msg_type ⇒ Integer
Returns the event message type.
-
#event_num ⇒ Integer
Returns the event number.
-
#game_id ⇒ String
Returns the game ID.
-
#home_description ⇒ String
Returns the home team’s play description.
-
#neutral_description ⇒ String
Returns the neutral play description.
-
#pc_time_string ⇒ String
Returns the period clock time string.
-
#period ⇒ Integer
Returns the period number.
-
#player1_id ⇒ Integer
Returns the first player’s ID.
-
#player1_name ⇒ String
Returns the first player’s name.
-
#player1_team_abbreviation ⇒ String
Returns the first player’s team abbreviation.
-
#player1_team_id ⇒ Integer
Returns the first player’s team ID.
-
#player2_id ⇒ Integer
Returns the second player’s ID.
-
#player2_name ⇒ String
Returns the second player’s name.
-
#player2_team_abbreviation ⇒ String
Returns the second player’s team abbreviation.
-
#player2_team_id ⇒ Integer
Returns the second player’s team ID.
-
#player3_id ⇒ Integer
Returns the third player’s ID.
-
#player3_name ⇒ String
Returns the third player’s name.
-
#player3_team_abbreviation ⇒ String
Returns the third player’s team abbreviation.
-
#player3_team_id ⇒ Integer
Returns the third player’s team ID.
-
#score ⇒ String
Returns the current score.
-
#score_margin ⇒ String
Returns the score margin.
-
#video_available ⇒ Integer
Returns whether video is available for this play.
-
#visitor_description ⇒ String
Returns the visitor team’s play description.
-
#wc_time_string ⇒ String
Returns the wall clock time string.
Instance Method Summary collapse
-
#description ⇒ String?
Returns the primary description for this play.
-
#game ⇒ Game?
Returns the game object for this play.
-
#player1 ⇒ Player?
(also: #player)
Returns the first player involved in this play.
-
#player2 ⇒ Player?
Returns the second player involved in this play.
-
#player3 ⇒ Player?
Returns the third player involved in this play.
Instance Attribute Details
#event_msg_action_type ⇒ Integer
Returns the event message action type
36 |
# File 'lib/nba/play.rb', line 36 attribute :event_msg_action_type, Shale::Type::Integer |
#event_msg_type ⇒ Integer
Returns the event message type
28 |
# File 'lib/nba/play.rb', line 28 attribute :event_msg_type, Shale::Type::Integer |
#event_num ⇒ Integer
Returns the event number
20 |
# File 'lib/nba/play.rb', line 20 attribute :event_num, Shale::Type::Integer |
#game_id ⇒ String
Returns the game ID
12 |
# File 'lib/nba/play.rb', line 12 attribute :game_id, Shale::Type::String |
#home_description ⇒ String
Returns the home team’s play description
68 |
# File 'lib/nba/play.rb', line 68 attribute :home_description, Shale::Type::String |
#neutral_description ⇒ String
Returns the neutral play description
76 |
# File 'lib/nba/play.rb', line 76 attribute :neutral_description, Shale::Type::String |
#pc_time_string ⇒ String
Returns the period clock time string
60 |
# File 'lib/nba/play.rb', line 60 attribute :pc_time_string, Shale::Type::String |
#period ⇒ Integer
Returns the period number
44 |
# File 'lib/nba/play.rb', line 44 attribute :period, Shale::Type::Integer |
#player1_id ⇒ Integer
Returns the first player’s ID
108 |
# File 'lib/nba/play.rb', line 108 attribute :player1_id, Shale::Type::Integer |
#player1_name ⇒ String
Returns the first player’s name
116 |
# File 'lib/nba/play.rb', line 116 attribute :player1_name, Shale::Type::String |
#player1_team_abbreviation ⇒ String
Returns the first player’s team abbreviation
132 |
# File 'lib/nba/play.rb', line 132 attribute :player1_team_abbreviation, Shale::Type::String |
#player1_team_id ⇒ Integer
Returns the first player’s team ID
124 |
# File 'lib/nba/play.rb', line 124 attribute :player1_team_id, Shale::Type::Integer |
#player2_id ⇒ Integer
Returns the second player’s ID
140 |
# File 'lib/nba/play.rb', line 140 attribute :player2_id, Shale::Type::Integer |
#player2_name ⇒ String
Returns the second player’s name
148 |
# File 'lib/nba/play.rb', line 148 attribute :player2_name, Shale::Type::String |
#player2_team_abbreviation ⇒ String
Returns the second player’s team abbreviation
164 |
# File 'lib/nba/play.rb', line 164 attribute :player2_team_abbreviation, Shale::Type::String |
#player2_team_id ⇒ Integer
Returns the second player’s team ID
156 |
# File 'lib/nba/play.rb', line 156 attribute :player2_team_id, Shale::Type::Integer |
#player3_id ⇒ Integer
Returns the third player’s ID
172 |
# File 'lib/nba/play.rb', line 172 attribute :player3_id, Shale::Type::Integer |
#player3_name ⇒ String
Returns the third player’s name
180 |
# File 'lib/nba/play.rb', line 180 attribute :player3_name, Shale::Type::String |
#player3_team_abbreviation ⇒ String
Returns the third player’s team abbreviation
196 |
# File 'lib/nba/play.rb', line 196 attribute :player3_team_abbreviation, Shale::Type::String |
#player3_team_id ⇒ Integer
Returns the third player’s team ID
188 |
# File 'lib/nba/play.rb', line 188 attribute :player3_team_id, Shale::Type::Integer |
#score ⇒ String
Returns the current score
92 |
# File 'lib/nba/play.rb', line 92 attribute :score, Shale::Type::String |
#score_margin ⇒ String
Returns the score margin
100 |
# File 'lib/nba/play.rb', line 100 attribute :score_margin, Shale::Type::String |
#video_available ⇒ Integer
Returns whether video is available for this play
204 |
# File 'lib/nba/play.rb', line 204 attribute :video_available, Shale::Type::Integer |
#visitor_description ⇒ String
Returns the visitor team’s play description
84 |
# File 'lib/nba/play.rb', line 84 attribute :visitor_description, Shale::Type::String |
#wc_time_string ⇒ String
Returns the wall clock time string
52 |
# File 'lib/nba/play.rb', line 52 attribute :wc_time_string, Shale::Type::String |
Instance Method Details
#description ⇒ String?
Returns the primary description for this play
212 213 214 |
# File 'lib/nba/play.rb', line 212 def description home_description || visitor_description || neutral_description end |
#game ⇒ Game?
Returns the game object for this play
222 223 224 |
# File 'lib/nba/play.rb', line 222 def game Games.find(game_id) end |
#player1 ⇒ Player? Also known as: player
Returns the first player involved in this play
232 233 234 |
# File 'lib/nba/play.rb', line 232 def player1 Players.find(player1_id) end |