Class: Sportradar::Nfl::Models::Play
- Inherits:
-
Object
- Object
- Sportradar::Nfl::Models::Play
- Defined in:
- lib/sportradar/nfl/models/play.rb
Direct Known Subclasses
Instance Method Summary collapse
- #clock ⇒ Object
- #details ⇒ Object
- #direction ⇒ Object
- #distance ⇒ Object
- #down ⇒ Object
- #drive_id ⇒ Object
- #formation ⇒ Object
- #game_id ⇒ Object
- #id ⇒ Object
-
#initialize(drive:, attributes:) ⇒ Play
constructor
A new instance of Play.
- #official? ⇒ Boolean
- #participants ⇒ Object
- #play_type ⇒ Object
- #quarter ⇒ Object
- #quarter_number ⇒ Object
- #sequence ⇒ Object
- #side ⇒ Object
- #summary ⇒ Object
- #team ⇒ Object
- #to_s ⇒ Object
- #type ⇒ Object
- #updated_at ⇒ Object
- #yard_line ⇒ Object
- #yards_to_first_down ⇒ Object
Constructor Details
#initialize(drive:, attributes:) ⇒ Play
Returns a new instance of Play.
5 6 7 8 |
# File 'lib/sportradar/nfl/models/play.rb', line 5 def initialize(drive:, attributes:) @drive = drive @attributes = attributes end |
Instance Method Details
#clock ⇒ Object
34 35 36 |
# File 'lib/sportradar/nfl/models/play.rb', line 34 def clock @attributes['clock'] end |
#details ⇒ Object
42 43 44 |
# File 'lib/sportradar/nfl/models/play.rb', line 42 def details @attributes['details'] end |
#direction ⇒ Object
86 87 88 |
# File 'lib/sportradar/nfl/models/play.rb', line 86 def direction @attributes['direction'] end |
#distance ⇒ Object
90 91 92 |
# File 'lib/sportradar/nfl/models/play.rb', line 90 def distance @attributes['distance'] end |
#down ⇒ Object
46 47 48 |
# File 'lib/sportradar/nfl/models/play.rb', line 46 def down @attributes['down'] end |
#drive_id ⇒ Object
22 23 24 |
# File 'lib/sportradar/nfl/models/play.rb', line 22 def drive_id @drive.id end |
#formation ⇒ Object
94 95 96 |
# File 'lib/sportradar/nfl/models/play.rb', line 94 def formation @attributes['formation'] end |
#game_id ⇒ Object
14 15 16 |
# File 'lib/sportradar/nfl/models/play.rb', line 14 def game_id @drive.game_id end |
#id ⇒ Object
38 39 40 |
# File 'lib/sportradar/nfl/models/play.rb', line 38 def id @attributes['id'] end |
#official? ⇒ Boolean
98 99 100 |
# File 'lib/sportradar/nfl/models/play.rb', line 98 def official? @attributes['official'] end |
#participants ⇒ Object
50 51 52 |
# File 'lib/sportradar/nfl/models/play.rb', line 50 def participants @attributes['participants'] end |
#play_type ⇒ Object
54 55 56 |
# File 'lib/sportradar/nfl/models/play.rb', line 54 def play_type @attributes['play_type'] end |
#quarter ⇒ Object
26 27 28 |
# File 'lib/sportradar/nfl/models/play.rb', line 26 def quarter @drive.quarter end |
#quarter_number ⇒ Object
30 31 32 |
# File 'lib/sportradar/nfl/models/play.rb', line 30 def quarter_number quarter.number end |
#sequence ⇒ Object
58 59 60 |
# File 'lib/sportradar/nfl/models/play.rb', line 58 def sequence @attributes['sequence'] end |
#side ⇒ Object
62 63 64 |
# File 'lib/sportradar/nfl/models/play.rb', line 62 def side @attributes['side'] end |
#summary ⇒ Object
66 67 68 |
# File 'lib/sportradar/nfl/models/play.rb', line 66 def summary @attributes['summary'] end |
#team ⇒ Object
18 19 20 |
# File 'lib/sportradar/nfl/models/play.rb', line 18 def team @drive.team end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/sportradar/nfl/models/play.rb', line 10 def to_s summary end |
#type ⇒ Object
70 71 72 |
# File 'lib/sportradar/nfl/models/play.rb', line 70 def type @attributes['type'] end |
#updated_at ⇒ Object
74 75 76 |
# File 'lib/sportradar/nfl/models/play.rb', line 74 def updated_at @attributes['updated'] end |
#yard_line ⇒ Object
78 79 80 |
# File 'lib/sportradar/nfl/models/play.rb', line 78 def yard_line @attributes['yard_line'] end |
#yards_to_first_down ⇒ Object
82 83 84 |
# File 'lib/sportradar/nfl/models/play.rb', line 82 def yards_to_first_down @attributes['yfd'] end |