Class: SportsDataApi::Ncaafb::Drive
- Inherits:
-
Object
- Object
- SportsDataApi::Ncaafb::Drive
- Defined in:
- lib/sports_data_api/ncaafb/drive.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#clock ⇒ Object
readonly
Returns the value of attribute clock.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#team ⇒ Object
readonly
Returns the value of attribute team.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #event_actions ⇒ Object
-
#initialize(event_hash) ⇒ Drive
constructor
A new instance of Drive.
- #play_actions ⇒ Object
Constructor Details
#initialize(event_hash) ⇒ Drive
Returns a new instance of Drive.
6 7 8 9 10 11 12 |
# File 'lib/sports_data_api/ncaafb/drive.rb', line 6 def initialize(event_hash) @id = event_hash["id"] @clock = event_hash["clock"] @type = event_hash["type"] @team= event_hash["team"] @actions = Actions.build_actions(event_hash["actions"]) end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/drive.rb', line 4 def actions @actions end |
#clock ⇒ Object (readonly)
Returns the value of attribute clock.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/drive.rb', line 4 def clock @clock end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/drive.rb', line 4 def id @id end |
#team ⇒ Object (readonly)
Returns the value of attribute team.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/drive.rb', line 4 def team @team end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/sports_data_api/ncaafb/drive.rb', line 4 def type @type end |
Instance Method Details
#event_actions ⇒ Object
18 19 20 |
# File 'lib/sports_data_api/ncaafb/drive.rb', line 18 def event_actions actions.select {|i| i.class == SportsDataApi::Nfl::EventAction } end |
#play_actions ⇒ Object
14 15 16 |
# File 'lib/sports_data_api/ncaafb/drive.rb', line 14 def play_actions actions.select {|i| i.class == SportsDataApi::Nfl::PlayAction} end |