Class: MLB::Boxscore
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- MLB::Boxscore
- Defined in:
- lib/mlb/boxscore.rb
Overview
Represents a game’s boxscore
Instance Attribute Summary collapse
-
#teams ⇒ BoxscoreTeams
Returns the teams data.
Class Method Summary collapse
-
.find(game:) ⇒ Boxscore
Retrieves the boxscore for a game.
Instance Attribute Details
#teams ⇒ BoxscoreTeams
Returns the teams data
62 |
# File 'lib/mlb/boxscore.rb', line 62 attribute :teams, BoxscoreTeams |
Class Method Details
.find(game:) ⇒ Boxscore
Retrieves the boxscore for a game
75 76 77 78 79 |
# File 'lib/mlb/boxscore.rb', line 75 def self.find(game:) game_pk = game.respond_to?(:game_pk) ? game.game_pk : game response = CLIENT.get("game/#{game_pk}/boxscore") from_json(response) end |