sportradar-api 0.19.0 → 0.19.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8dc7fd8b3ea2527e80d2450060864338619def6cefdfc95a9bc9dcf1a4f9b52b
4
- data.tar.gz: 9ef4960b1876828a908f89e48974ba72e69460094b4b763463fc23e0cb5fb538
3
+ metadata.gz: ce9f7183e1c4345e6cd8645eb7464f474125c1c8adb0e8d56c14d950637339d9
4
+ data.tar.gz: 94b6ed0d85b2158437da00526138c9b451342837ba0a130ba48f11c23417b58d
5
5
  SHA512:
6
- metadata.gz: 593bbf87290172584b6ae110f8e06576ea5d44eee653d02b78d2810f4598fec2da9f9b2506ddc40811a3effefc8190080476b2d8a7febbf908724a2e46cdd20a
7
- data.tar.gz: bf275cbedcf92089994c9882903780882dee634f65e7abe0fd0a3f1f0b85052f6d9efec0d07761acb460c750a7d36f1c76f6096f261f10821c1b8c5913de3523
6
+ metadata.gz: 414ec76183a9bfc0aecbb90246304b4636a004ada1eabb118c51e55900862a35a3caa7d2976809c99658f0f3d848d25c5544669fa0b58a1469f41a53faaa8adc
7
+ data.tar.gz: 17238d7e343ca736d632e5d60ebbb708ac6362bc6f07da6f26527cfe93958956557c4aa8a0b4007b9675175be675079d59379fa7aab43391e292a810b40b9d16
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sportradar-api (0.19.0)
4
+ sportradar-api (0.19.1)
5
5
  activesupport
6
6
  httparty (>= 0.14.0)
7
7
 
@@ -13,7 +13,7 @@ sport.get_competitions
13
13
  comp = sport.competitions.first
14
14
 
15
15
  api = Sportradar::Api::Odds::PlayerOdds.api
16
- comp = Sportradar::Api::Odds::Competition.new({'id' => 'sr:competition:234'}, api: api)
16
+ comp = Sportradar::Api::Odds::Competition.new({'id' => 'sr:competition:109'}, api: api)
17
17
  data = comp.get_player_props
18
18
  comp.sport_events
19
19
  event = comp.sport_events.first
@@ -29,12 +29,23 @@ module Sportradar
29
29
 
30
30
  def get_player_props
31
31
  data = fetch_player_props
32
- create_data(@sport_events_hash, data["competition_sport_events_players_props"], klass: SportEvent, api: api)
32
+ prop_data = if data["competition_sport_events_players_props"].size == 10
33
+ arr = data["competition_sport_events_players_props"]
34
+ data = fetch_player_props(start: 10)
35
+ arr += data["competition_sport_events_players_props"]
36
+ if data["competition_sport_events_players_props"].size == 10
37
+ data = fetch_player_props(start: 20)
38
+ arr += data["competition_sport_events_players_props"]
39
+ end
40
+ else
41
+ data["competition_sport_events_players_props"]
42
+ end
43
+ create_data(@sport_events_hash, prop_data, klass: SportEvent, api: api)
33
44
  data
34
45
  end
35
46
 
36
- def fetch_player_props
37
- api.get_data(path_player_props)
47
+ def fetch_player_props(params = {})
48
+ api.get_data(path_player_props, params)
38
49
  end
39
50
 
40
51
  # url path helpers
@@ -12,8 +12,8 @@ module Sportradar
12
12
  self
13
13
  end
14
14
 
15
- def get_data(url)
16
- data = get request_url(url)
15
+ def get_data(url, extra_params = {})
16
+ data = get(request_url(url), extra_params)
17
17
  if data.is_a?(::Sportradar::Api::Error)
18
18
  puts request_url(url)
19
19
  puts
@@ -1,5 +1,5 @@
1
1
  module Sportradar
2
2
  module Api
3
- VERSION = "0.19.0"
3
+ VERSION = "0.19.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportradar-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Eggett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-06 00:00:00.000000000 Z
11
+ date: 2022-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler