Class: MLB::LiveFeed
- Inherits:
-
Shale::Mapper
- Object
- Shale::Mapper
- MLB::LiveFeed
- Defined in:
- lib/mlb/live_feed.rb
Overview
Represents the live game feed data
Instance Attribute Summary collapse
-
#game_data ⇒ GameData
Returns the game metadata.
-
#game_pk ⇒ Integer
Returns the game primary key.
-
#link ⇒ String
Returns the API link.
-
#live_data ⇒ LiveData
Returns the live game data.
Class Method Summary collapse
-
.find(game:) ⇒ LiveFeed
Retrieves the live feed for a game.
Instance Attribute Details
#game_data ⇒ GameData
Returns the game metadata
98 |
# File 'lib/mlb/live_feed.rb', line 98 attribute :game_data, GameData |
#game_pk ⇒ Integer
Returns the game primary key
82 |
# File 'lib/mlb/live_feed.rb', line 82 attribute :game_pk, Shale::Type::Integer |
#link ⇒ String
Returns the API link
90 |
# File 'lib/mlb/live_feed.rb', line 90 attribute :link, Shale::Type::String |
#live_data ⇒ LiveData
Returns the live game data
106 |
# File 'lib/mlb/live_feed.rb', line 106 attribute :live_data, LiveData |
Class Method Details
.find(game:) ⇒ LiveFeed
Retrieves the live feed for a game
124 125 126 127 128 |
# File 'lib/mlb/live_feed.rb', line 124 def self.find(game:) game_pk = game.respond_to?(:game_pk) ? game.game_pk : game response = CLIENT.get("game/#{game_pk}/feed/live") from_json(response) end |