Class: MLB::GameContent
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- MLB::GameContent
- Defined in:
- lib/mlb/game_content.rb
Overview
Represents the game content
Instance Attribute Summary collapse
-
#highlights ⇒ HighlightsSection
Returns the highlights.
-
#link ⇒ String
Returns the API link.
-
#media ⇒ GameContentMedia
Returns the media info.
Class Method Summary collapse
-
.find(game:) ⇒ GameContent
Retrieves the content for a game.
Instance Attribute Details
#highlights ⇒ HighlightsSection
Returns the highlights
228 |
# File 'lib/mlb/game_content.rb', line 228 attribute :highlights, HighlightsSection |
#link ⇒ String
Returns the API link
212 |
# File 'lib/mlb/game_content.rb', line 212 attribute :link, Shale::Type::String |
#media ⇒ GameContentMedia
Returns the media info
220 |
# File 'lib/mlb/game_content.rb', line 220 attribute :media, GameContentMedia |
Class Method Details
.find(game:) ⇒ GameContent
Retrieves the content for a game
245 246 247 248 249 |
# File 'lib/mlb/game_content.rb', line 245 def self.find(game:) game_pk = game.respond_to?(:game_pk) ? game.game_pk : game response = CLIENT.get("game/#{game_pk}/content") from_json(response) end |