mlb_stats_api 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4a7b94d68493363d447c18a5e8d56994508b1a1b6e77a7136e83e07193b6e2b
4
- data.tar.gz: 8baf4f5bae5b634f50bbe3bb0c08ec93fd7ad87bd003b645185dc8e36b1da090
3
+ metadata.gz: 369fb8047b80686113145a662d6af11c4598f4bd5527e40b32460b2e5b0b870d
4
+ data.tar.gz: 0c929d12979256f6fd0a1e1210a54d0af9c2b1fce76c896df1176aa714bf59ee
5
5
  SHA512:
6
- metadata.gz: c183c8ba29eac57b6c8487dce7300f547db057c0e33873a831d6d8c365d3493e26f8c8236a9f80efef401be73b88504695ebe9b9a51b566caeb3aad613efca80
7
- data.tar.gz: 4ec7c69b0d19650a42629bd4d914a4c24d5574fa325f4285fa953def77d7e320a09464a2a9e4dbbb44836841b135070e15f19ba2f963b7a0bfe39795d7ae1aed
6
+ metadata.gz: f0adb73c36e3805a07cd38f1df6917d0035d1aa94b1f1b08128975d046954a17d291eaf57dc94044b129b584aaa816f27b5cff442d43c61eedd176d16f5b45db
7
+ data.tar.gz: 1cc3a2474f00e6096d816190b00b12a54d331810349f54f14e388486e7c397198e9594a200c590e03437c1f866e4c5983fea14811de02c95cf64993ca590c121
@@ -2,22 +2,22 @@
2
2
 
3
3
  module MLBStatsAPI
4
4
  class ColorFeed < Base
5
- attr_reader :id
5
+ attr_reader :game_pk
6
6
 
7
- def initialize(api, data)
7
+ def initialize(api, game_pk, data)
8
8
  @api = api
9
9
  @data = data
10
-
11
- # If we need to nuke and start over, keep this piece
12
- @id = data['game_pk']
10
+ @game_pk = game_pk
13
11
  end
14
12
 
15
13
  def items
14
+ return [] unless @data
15
+
16
16
  @data['items']
17
17
  end
18
18
 
19
19
  def reload!
20
- @data = @api.get("/game/#{@id}/feed/color")
20
+ @data = @api.get("/game/#{@game_pk}/feed/color")
21
21
 
22
22
  true
23
23
  rescue Net::OpenTimeout
@@ -44,6 +44,7 @@ module MLBStatsAPI
44
44
  def color_feed(game_id, timecode: nil)
45
45
  MLBStatsAPI::ColorFeed.new(
46
46
  self,
47
+ game_id,
47
48
  get("/game/#{game_id}/feed/color", timecode: timecode)
48
49
  )
49
50
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MLBStatsAPI
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mlb_stats_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Hoffman