Class: NBA::WinProbabilityPoint
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- NBA::WinProbabilityPoint
- Defined in:
- lib/nba/win_probability_point.rb
Overview
Represents a win probability data point
Instance Attribute Summary collapse
-
#event_num ⇒ Integer
Returns the event number.
-
#game_id ⇒ String
Returns the game ID.
-
#home_description ⇒ String
Returns the home team play description.
-
#home_pct ⇒ Float
Returns the home team win probability.
-
#home_pts ⇒ Integer
Returns the home team points at this event.
-
#home_score_by ⇒ Integer
Returns points scored by home team on this event.
-
#location ⇒ String
Returns the event location.
-
#neutral_description ⇒ String
Returns the neutral play description.
-
#period ⇒ Integer
Returns the period.
-
#seconds_remaining ⇒ Integer
Returns seconds remaining in the period.
-
#visitor_description ⇒ String
Returns the visitor team play description.
-
#visitor_pct ⇒ Float
Returns the visitor team win probability.
-
#visitor_pts ⇒ Integer
Returns the visitor team points at this event.
-
#visitor_score_by ⇒ Integer
Returns points scored by visitor team on this event.
Instance Method Summary collapse
-
#description ⇒ String?
Returns the description for this event.
-
#margin ⇒ Integer?
Returns the score margin (positive = home leading).
Instance Attribute Details
#event_num ⇒ Integer
Returns the event number
20 |
# File 'lib/nba/win_probability_point.rb', line 20 attribute :event_num, Shale::Type::Integer |
#game_id ⇒ String
Returns the game ID
12 |
# File 'lib/nba/win_probability_point.rb', line 12 attribute :game_id, Shale::Type::String |
#home_description ⇒ String
Returns the home team play description
92 |
# File 'lib/nba/win_probability_point.rb', line 92 attribute :home_description, Shale::Type::String |
#home_pct ⇒ Float
Returns the home team win probability
28 |
# File 'lib/nba/win_probability_point.rb', line 28 attribute :home_pct, Shale::Type::Float |
#home_pts ⇒ Integer
Returns the home team points at this event
44 |
# File 'lib/nba/win_probability_point.rb', line 44 attribute :home_pts, Shale::Type::Integer |
#home_score_by ⇒ Integer
Returns points scored by home team on this event
60 |
# File 'lib/nba/win_probability_point.rb', line 60 attribute :home_score_by, Shale::Type::Integer |
#location ⇒ String
Returns the event location
116 |
# File 'lib/nba/win_probability_point.rb', line 116 attribute :location, Shale::Type::String |
#neutral_description ⇒ String
Returns the neutral play description
100 |
# File 'lib/nba/win_probability_point.rb', line 100 attribute :neutral_description, Shale::Type::String |
#period ⇒ Integer
Returns the period
76 |
# File 'lib/nba/win_probability_point.rb', line 76 attribute :period, Shale::Type::Integer |
#seconds_remaining ⇒ Integer
Returns seconds remaining in the period
84 |
# File 'lib/nba/win_probability_point.rb', line 84 attribute :seconds_remaining, Shale::Type::Integer |
#visitor_description ⇒ String
Returns the visitor team play description
108 |
# File 'lib/nba/win_probability_point.rb', line 108 attribute :visitor_description, Shale::Type::String |
#visitor_pct ⇒ Float
Returns the visitor team win probability
36 |
# File 'lib/nba/win_probability_point.rb', line 36 attribute :visitor_pct, Shale::Type::Float |
#visitor_pts ⇒ Integer
Returns the visitor team points at this event
52 |
# File 'lib/nba/win_probability_point.rb', line 52 attribute :visitor_pts, Shale::Type::Integer |
#visitor_score_by ⇒ Integer
Returns points scored by visitor team on this event
68 |
# File 'lib/nba/win_probability_point.rb', line 68 attribute :visitor_score_by, Shale::Type::Integer |
Instance Method Details
#description ⇒ String?
Returns the description for this event
124 125 126 |
# File 'lib/nba/win_probability_point.rb', line 124 def description home_description || neutral_description || visitor_description end |
#margin ⇒ Integer?
Returns the score margin (positive = home leading)
134 135 136 137 138 |
# File 'lib/nba/win_probability_point.rb', line 134 def margin return nil unless home_pts && visitor_pts home_pts - visitor_pts end |