Class: MLB::GameUniforms

Inherits:
Shale::Mapper
  • Object
show all
Defined in:
lib/mlb/uniforms.rb

Overview

Represents game uniform information for both teams

Class Method Summary collapse

Class Method Details

.find(game:) ⇒ GameUniforms

Retrieves uniform information for a game

Examples:

Get uniforms for a game

MLB::GameUniforms.find(game: 745571)

Get uniforms using a ScheduledGame object

MLB::GameUniforms.find(game: scheduled_game)

Parameters:

Returns:



65
66
67
68
69
# File 'lib/mlb/uniforms.rb', line 65

def self.find(game:)
  game_pk = game.respond_to?(:game_pk) ? game.game_pk : game
  response = CLIENT.get("uniforms/game?#{Utils.build_query(gamePk: game_pk)}")
  from_json(response)
end