sportradar-api 0.20.0.pre → 0.20.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/sportradar/api/mma/fight.rb +16 -1
- data/lib/sportradar/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a4d74bbc98d4c89505d04f448536bc7ec81fff059ca2a2d4099bb52aec5be0a
|
4
|
+
data.tar.gz: 8c4f9b76a6f8abc00a6ec0b674c8b09a34cb91a16151622998a7378b74c7e557
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19e8efe729085c89fe2845e8b3758b76589c947d267917bf1291d390ce2818c60b37a4d66e3ff327848b66ec74ab88c984f26570faf72a79766b7f4b9fce1847
|
7
|
+
data.tar.gz: 5b46459f020f0321e1b5af4ba50c31722a7d35d751a833d12af1216b5271febf7374268bfc598ad2820cb12233586eec16d7b35506395232afa9a4254643e573
|
data/Gemfile.lock
CHANGED
@@ -2,7 +2,7 @@ module Sportradar
|
|
2
2
|
module Api
|
3
3
|
module Mma
|
4
4
|
class Fight < Data
|
5
|
-
attr_accessor :response, :id, :season, :start_time, :start_time_confirmed, :sport_event_context, :coverage, :venue, :status, :match_status, :winner_id, :final_round, :final_round_length, :end_method, :winner, :scheduled_length, :weight_class, :title_fight
|
5
|
+
attr_accessor :response, :id, :season, :start_time, :start_time_confirmed, :sport_event_context, :coverage, :venue, :status, :match_status, :winner_id, :final_round, :final_round_length, :end_method, :winner, :scheduled_length, :weight_class, :title_fight, :statistics
|
6
6
|
|
7
7
|
def initialize(data, **opts)
|
8
8
|
@response = data
|
@@ -48,6 +48,7 @@ module Sportradar
|
|
48
48
|
|
49
49
|
|
50
50
|
update_fighters(data) if data['competitors']
|
51
|
+
update_statistics(data['statistics']) if data["statistics"]
|
51
52
|
|
52
53
|
self
|
53
54
|
end
|
@@ -77,6 +78,20 @@ module Sportradar
|
|
77
78
|
create_data(@fighters_hash, data['competitors'], klass: Fighter, api: api, fight: self)
|
78
79
|
end
|
79
80
|
end
|
81
|
+
|
82
|
+
def update_statistics(data)
|
83
|
+
@statistics['totals'] = structure_stats(data["totals"]) if data["totals"]
|
84
|
+
if data['periods']
|
85
|
+
data['periods'].each do |round|
|
86
|
+
@statistics[round['number']] = structure_stats(round)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def structure_stats(data)
|
92
|
+
data['competitors'].map { |comp_data| [comp_data['id'], comp_data.merge(comp_data.delete('statistics'))] }.to_h
|
93
|
+
end
|
94
|
+
|
80
95
|
def api
|
81
96
|
@api ||= Sportradar::Api::Mma.new
|
82
97
|
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.20.0.
|
4
|
+
version: 0.20.0.pre2
|
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-09-
|
11
|
+
date: 2022-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|