Class: MLB::HomeRunDerby
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- MLB::HomeRunDerby
- Defined in:
- lib/mlb/home_run_derby.rb
Overview
Represents home run derby data
Instance Attribute Summary collapse
-
#info ⇒ DerbyInfo
Returns the derby info.
-
#rounds ⇒ Array<DerbyRound>
Returns the rounds.
Class Method Summary collapse
-
.find(game:) ⇒ HomeRunDerby
Retrieves home run derby data for a game.
Instance Attribute Details
#info ⇒ DerbyInfo
Returns the derby info
255 |
# File 'lib/mlb/home_run_derby.rb', line 255 attribute :info, DerbyInfo |
#rounds ⇒ Array<DerbyRound>
Returns the rounds
263 |
# File 'lib/mlb/home_run_derby.rb', line 263 attribute :rounds, DerbyRound, collection: true |
Class Method Details
.find(game:) ⇒ HomeRunDerby
Retrieves home run derby data for a game
279 280 281 282 283 |
# File 'lib/mlb/home_run_derby.rb', line 279 def self.find(game:) game_pk = game.respond_to?(:game_pk) ? game.game_pk : game response = CLIENT.get("homeRunDerby/#{game_pk}") from_json(response) end |