sportradar-api 0.10.13 → 0.10.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,111 @@
1
+ module Sportradar
2
+ module Api
3
+ module Baseball
4
+ class Pitch < Data
5
+ attr_accessor :response, :id, :at_bat, :outcome_id, :status, :count, :is_ab_over, :warming_up
6
+
7
+ def initialize(data, **opts)
8
+ @response = data
9
+ @api = opts[:api]
10
+ @at_bat = opts[:at_bat]
11
+ # @half_inning = opts[:half_inning]
12
+
13
+ @id = data["id"]
14
+
15
+ update(data)
16
+ end
17
+ def ==(other)
18
+ @id == other.id && @count == other.count && @outcome_id == other.outcome_id
19
+ end
20
+ def update(data, **opts)
21
+
22
+ @outcome_id = data['outcome_id'] if data['outcome_id']
23
+ @description = data['description'] if data['description']
24
+ @status = data['status'] if data['status']
25
+
26
+ parse_hit(data)
27
+ parse_runners(data['runners']) if data['runners']
28
+ parse_pitcher(data['pitcher']) if data['pitcher']
29
+ parse_flags(data['flags']) if data['flags']
30
+ parse_count(data['count']) if data['count']
31
+ parse_warming_up(data['warming_up']) if data['warming_up']
32
+ parse_fielders(data['fielders']) if data['fielders']
33
+ parse_errors(data['errors']) if data['errors']
34
+ end
35
+
36
+ def pitches
37
+ @pitches_hash.values
38
+ end
39
+
40
+ def parse_hit(data)
41
+ @hit_type = data['hit_type'] if data['hit_type']
42
+ @hit_location = data['hit_location'] if data['hit_location']
43
+ end
44
+
45
+ def parse_runners(data)
46
+ @runners = data.map { |hash| Runner.new(hash) }
47
+ end
48
+
49
+ def parse_errors(data)
50
+ @runners = data.map { |hash| Error.new(hash) }
51
+ end
52
+
53
+ def parse_fielders(data)
54
+ @fielders = data.map { |hash| Fielder.new(hash) }
55
+ end
56
+
57
+ def parse_pitcher(data)
58
+ @type = data['pitch_type'] if data['pitch_type']
59
+ @speed = data['pitch_speed'] if data['pitch_speed']
60
+ @x = data['pitch_x'] if data['pitch_x']
61
+ @y = data['pitch_y'] if data['pitch_y']
62
+ @zone = data['pitch_zone'] if data['pitch_zone']
63
+
64
+ @total_pitch_count = data['pitch_count'] if data['pitch_count']
65
+ end
66
+
67
+ def parse_flags(data)
68
+ @is_ab_over = data['is_ab_over'] if data['is_ab_over']
69
+ @is_bunt = data['is_bunt'] if data['is_bunt']
70
+ @is_bunt_shown = data['is_bunt_shown'] if data['is_bunt_shown']
71
+ @is_hit = data['is_hit'] if data['is_hit']
72
+ @is_wild_pitch = data['is_wild_pitch'] if data['is_wild_pitch']
73
+ @is_passed_ball = data['is_passed_ball'] if data['is_passed_ball']
74
+ @is_double_play = data['is_double_play'] if data['is_double_play']
75
+ @is_triple_play = data['is_triple_play'] if data['is_triple_play']
76
+ end
77
+
78
+ def parse_count(data)
79
+ @count = data
80
+ @balls = data['balls'] if data['balls']
81
+ @strikes = data['strikes'] if data['strikes']
82
+ @outs = data['outs'] if data['outs']
83
+ @atbat_pitch_count = data['pitch_count'] if data['pitch_count']
84
+ end
85
+
86
+ def parse_warming_up(data)
87
+ @warming_id = data['id']
88
+ @warming_player_id = data['player_id']
89
+ @warming_team_id = data['team_id']
90
+ @warming_last_name = data['last_name']
91
+ @warming_first_name = data['first_name']
92
+ @warming_preferred_name = data['preferred_name']
93
+ @warming_jersey_number = data['jersey_number']
94
+ @warming_up = "#{data['preferred_name'] || data['first_name']} #{data['last_name']}"
95
+ puts data unless data['last_name']
96
+ end
97
+
98
+ def parse_steal(data)
99
+
100
+ end
101
+
102
+ {"type"=>"steal", "id"=>"76762fd9-683c-42f2-8c72-8d9fd4f5bc7b", "status"=>"official", "created_at"=>"2017-05-06T02:56:49+00:00", "pitcher"=>{"id"=>"9dd06397-4353-44e8-81bb-6e88a75e42b5"}, "runners"=>[{"id"=>"3e39fe20-6dca-4894-807b-1ce76ff93e29", "starting_base"=>1, "ending_base"=>1, "outcome_id"=>"", "out"=>false, "last_name"=>"Owings", "first_name"=>"Christopher", "preferred_name"=>"Chris", "jersey_number"=>"16"}]}
103
+
104
+ {"type"=>"steal", "id"=>"df01b116-afcd-467f-9b9c-99d3891629c6", "status"=>"official", "created_at"=>"2017-05-06T03:00:58+00:00", "pitcher"=>{"id"=>"90fb6719-5135-42f3-88c0-0ccde448368c"}, "runners"=>[{"id"=>"106e6fb6-6460-412e-abdb-9f73469a27b9", "starting_base"=>1, "ending_base"=>1, "outcome_id"=>"CK", "out"=>false, "last_name"=>"DeShields", "first_name"=>"Delino", "preferred_name"=>"Delino", "jersey_number"=>"3"}]}
105
+ {"type"=>"steal", "id"=>"37c9192d-cac9-4320-b721-f68955eecf24", "status"=>"official", "created_at"=>"2017-05-06T03:02:16+00:00", "pitcher"=>{"id"=>"90fb6719-5135-42f3-88c0-0ccde448368c"}, "runners"=>[{"id"=>"106e6fb6-6460-412e-abdb-9f73469a27b9", "starting_base"=>1, "ending_base"=>1, "outcome_id"=>"CK", "out"=>false, "last_name"=>"DeShields", "first_name"=>"Delino", "preferred_name"=>"Delino", "jersey_number"=>"3"}]}
106
+ {"type"=>"steal", "id"=>"b8dcebfa-e02c-470e-ba73-e9b6b553cc0d", "status"=>"official", "created_at"=>"2017-05-06T03:38:48+00:00", "pitcher"=>{"id"=>"1a2638a3-28df-46b3-9cca-0f8eb29b581f"}, "runners"=>[{"id"=>"2847c4e0-01be-46bd-992e-701ee447e3f5", "starting_base"=>1, "ending_base"=>1, "outcome_id"=>"CK", "out"=>false, "last_name"=>"Upton", "first_name"=>"Justin", "preferred_name"=>"Justin", "jersey_number"=>"8"}, {"id"=>"f27a7574-57db-4eeb-8f88-377048806de2", "starting_base"=>3, "ending_base"=>3, "outcome_id"=>"", "out"=>false, "last_name"=>"Martínez", "first_name"=>"Victor", "preferred_name"=>"Victor", "jersey_number"=>"41"}]}
107
+
108
+ end
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,119 @@
1
+ module Sportradar
2
+ module Api
3
+ module Baseball
4
+ class Player < Data
5
+ attr_accessor :response, :id, :number, :full_name, :first_name, :last_name, :position, :birth_place, :college, :height, :weight, :draft, :hitting, :pitching, :fielding
6
+
7
+ def initialize(data, **opts)
8
+ @response = data # comment this out when done developing
9
+ @api = opts[:api]
10
+ # @team = opts[:team]
11
+
12
+ @id = data["id"]
13
+
14
+ update(data, **opts)
15
+ end
16
+
17
+ def name # to match api for NFL::Player
18
+ full_name
19
+ end
20
+ def display_name
21
+ full_name || "#{@preferred_name || @first_name} #{@last_name}"
22
+ end
23
+ def jersey
24
+ @jersey_number
25
+ end
26
+
27
+ def birth_date # to match api for NFL::Player
28
+ @birthdate
29
+ end
30
+
31
+ def update(data, **opts)
32
+ @depth = data['depth'] if data['depth']
33
+ @experience = data['experience'] if data['experience']
34
+ @birth_place = data['birth_place'].gsub(',,', ', ') if data['birth_place']
35
+ @college = data['college'] if data['college']
36
+
37
+ # from team roster
38
+ @status = data['status'] if data['status']
39
+ @position = data['position'] if data['position']
40
+ @primary_position = data['primary_position'] if data['primary_position']
41
+ @first_name = data['first_name'] if data['first_name']
42
+ @last_name = data['last_name'] if data['last_name']
43
+ @preferred_name = data['preferred_name'] if data['preferred_name']
44
+ @jersey_number = data['jersey_number'] if data['jersey_number']
45
+ @full_name = data['full_name'] if data['full_name']
46
+ @mlbam_id = data['mlbam_id'] if data['mlbam_id']
47
+ @height = data['height'] if data['height']
48
+ @weight = data['weight'] if data['weight']
49
+ @throw_hand = data['throw_hand'] if data['throw_hand']
50
+ @bat_hand = data['bat_hand'] if data['bat_hand']
51
+ @high_school = data['high_school'] if data['high_school']
52
+ @birthdate = data['birthdate'] if data['birthdate']
53
+ @birthstate = data['birthstate'] if data['birthstate']
54
+ @birthcountry = data['birthcountry'] if data['birthcountry']
55
+ @birthcity = data['birthcity'] if data['birthcity']
56
+ @pro_debut = data['pro_debut'] if data['pro_debut']
57
+ @updated = data['updated'] if data['updated']
58
+ @active = data['active'] if data['active']
59
+
60
+
61
+ update_injuries(data)
62
+ update_draft(data)
63
+
64
+ # @team.update_player_stats(self, data['statistics'], opts[:game]) if data['statistics']
65
+ if stats = data['statistics']
66
+ @fielding = stats.dig('fielding', 'overall')
67
+ @pitching = stats.dig('pitching', 'overall')
68
+ @hitting = stats.dig('hitting', 'overall')
69
+
70
+ # used to be @team, lets leave as opt until it needs to go back
71
+ opts[:team].update_player_stats(self, stats)
72
+ end
73
+
74
+ self
75
+ end
76
+
77
+ def injured?
78
+ !!(@injury && @injury.out?)
79
+ end
80
+
81
+ def age
82
+ if birth_date.present?
83
+ now = Time.now.utc.to_date
84
+ dob = birth_date.to_date
85
+ now.year - dob.year - ((now.month > dob.month || (now.month == dob.month && now.day >= dob.day)) ? 0 : 1)
86
+ end
87
+ end
88
+
89
+ def update_draft(data)
90
+ @draft = data['draft'] if data['draft'] # {"team_id"=>"583ec825-fb46-11e1-82cb-f4ce4684ea4c", "year"=>"2012", "round"=>"1", "pick"=>"30"},
91
+ end
92
+ def update_injuries(data)
93
+ # @injury = Injury.new(data['injuries']) if data['injuries']
94
+ # {"injury"=>
95
+ # {"id"=>"06423591-3fc1-4d2b-8c60-a3f30d735345",
96
+ # "comment"=>"Ezeli suffered a setback in his recovery from a procedure on his knee and there is no timetable for his return, according to Jason Quick of csnnw.com.",
97
+ # "desc"=>"Knee",
98
+ # "status"=>"Out",
99
+ # "start_date"=>"2016-10-25",
100
+ # "update_date"=>"2016-11-09"}}}
101
+ end
102
+
103
+ def api
104
+ @api || Sportradar::Api::Baseball::Mlb.new
105
+ end
106
+
107
+ end
108
+ end
109
+ end
110
+ end
111
+
112
+ __END__
113
+
114
+ mlb = Sportradar::Api::Baseball::Mlb::Hierarchy.new
115
+ mlb.get_hierarchy;
116
+ t = mlb.teams.first;
117
+ t.get_season_stats(2016);
118
+ t.players.sample
119
+
@@ -0,0 +1,46 @@
1
+ module Sportradar
2
+ module Api
3
+ module Baseball
4
+ class Record < Data
5
+ attr_accessor :id, :team, :wins, :losses, :win_pct, :streak, :games_back #, :runs_for, :runs_against, :run_diff, :games_behind, :streak
6
+ alias :games_behind :games_back
7
+
8
+ def initialize(data, type: 'overall', **opts)
9
+ @team = opts[:team]
10
+ @type = type
11
+
12
+ update(data, **opts)
13
+ end
14
+
15
+ def profile
16
+ Profile.new(self)
17
+ end
18
+
19
+ def update(data, **opts)
20
+ @wins = data["win"]
21
+ @losses = data["loss"]
22
+ @win_pct = data["win_p"]
23
+ @home_win = data["home_win"]
24
+ @home_loss = data["home_loss"]
25
+ @away_win = data["away_win"]
26
+ @away_loss = data["away_loss"]
27
+ @streak = data["streak"]
28
+ @e_win = data["e_win"]
29
+ @e_loss = data["e_loss"]
30
+ @c_win = data["c_win"]
31
+ @c_loss = data["c_loss"]
32
+ @w_win = data["w_win"]
33
+ @w_loss = data["w_loss"]
34
+ @al_win = data["al_win"]
35
+ @al_loss = data["al_loss"]
36
+ @last_10_won = data["last_10_won"]
37
+ @last_10_lost = data["last_10_lost"]
38
+ @games_back = data["games_back"]
39
+ @wild_card_back = data["wild_card_back"]
40
+ @elimination_number = data["elimination_number"]
41
+ end
42
+
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,30 @@
1
+ module Sportradar
2
+ module Api
3
+ module Baseball
4
+ class Runner < Data
5
+ attr_accessor :response, :id, :starting_base, :ending_base, :outcome_id, :out, :description, :fielders
6
+
7
+ def initialize(data, **opts)
8
+ @response = data
9
+ # @game = opts[:game]
10
+
11
+ update(data)
12
+ end
13
+ def update(data, **opts)
14
+ @id = data["id"]
15
+ @starting_base = data["starting_base"]
16
+ @ending_base = data["ending_base"]
17
+ @outcome_id = data["outcome_id"]
18
+ @out = data["out"]
19
+ @last_name = data["last_name"]
20
+ @first_name = data["first_name"]
21
+ @preferred_name = data["preferred_name"]
22
+ @jersey_number = data["jersey_number"]
23
+ @description = data['description']
24
+ @fielders = data['fielders'].map { |hash| Fielder.new(hash) } if data['fielders']
25
+ end
26
+
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,86 @@
1
+ module Sportradar
2
+ module Api
3
+ module Baseball
4
+ class Scoring < Data
5
+ attr_accessor :response, :api, :id, :home, :away, :scores
6
+
7
+ def initialize(data, **opts)
8
+ @api = opts[:api]
9
+ @game = opts[:game]
10
+
11
+ @scores = {}
12
+ @id = data['id']
13
+
14
+ update(data, **opts)
15
+ end
16
+
17
+ def update(data, source: nil, **opts)
18
+ new_scores = case source
19
+ when :box
20
+ parse_from_box(data)
21
+ when :pbp
22
+ parse_from_pbp(data)
23
+ when :summary
24
+ parse_from_box(data)
25
+ when :rhe
26
+ data
27
+ else
28
+ # if data['quarter'] || data['half']
29
+ # parse_from_pbp(data)
30
+ # elsif data['team']
31
+ # parse_from_box(data)
32
+ # else # schedule requests
33
+ # {}
34
+ # end
35
+ {}
36
+ end
37
+ # parse data structure
38
+ # handle data from team (all quarters)
39
+ # handle data from quarter (both teams)
40
+ # handle data from game?
41
+ @scores.each { |k, v| v.merge!(new_scores.delete(k) || {} ) }
42
+ new_scores.each { |k, v| @scores.merge!(k => v) }
43
+ end
44
+
45
+ def runs(team_id)
46
+ @scores.dig(team_id, 'runs').to_i
47
+ end
48
+ def hits(team_id)
49
+ @scores.dig(team_id, 'hits').to_i
50
+ end
51
+ def errors(team_id)
52
+ @scores.dig(team_id, 'errors').to_i
53
+ end
54
+
55
+ alias :points :runs
56
+
57
+ private
58
+
59
+ def parse_from_pbp(data)
60
+ scoring = data['innings'].map {|i| i['scoring'] }.compact
61
+ return {} if scoring.empty?
62
+ scoring.each_with_object({}).with_index(1) do |(hash, memo), idx|
63
+ memo[idx] = {hash.dig('home', 'id') => hash.dig('home', 'runs'), hash.dig('away', 'id') => hash.dig('away', 'runs')}
64
+ end
65
+ end
66
+
67
+ def parse_from_box(data)
68
+ id = data.dig('home', 'id')
69
+ da = data.dig('home', 'scoring')
70
+ return {} unless da
71
+ da.each { |h| h[id] = h.delete('runs') }
72
+ id = data.dig('away', 'id')
73
+ db = data.dig('away', 'scoring')
74
+ return {} unless db
75
+ db.each { |h| h[id] = h.delete('runs') }
76
+ da.zip(db).map{ |a, b| [a['sequence'].to_i, a.merge(b)] }.sort{ |(a,_), (b,_)| a <=> b }.to_h
77
+ end
78
+
79
+ def parse_from_summary(data)
80
+ #
81
+ end
82
+
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,147 @@
1
+ module Sportradar
2
+ module Api
3
+ module Baseball
4
+ class Team < Data
5
+ attr_accessor :response, :id, :market, :name, :alias, :full_name, :venue, :records, :player_stats, :team_stats
6
+
7
+ def initialize(data, **opts)
8
+ @response = data # comment this out when done developing
9
+ @api = opts[:api]
10
+ @id = data['id']
11
+
12
+ @games_hash = {}
13
+ @players_hash = {}
14
+ @player_stats = {}
15
+ @records = {}
16
+ @stats = nil
17
+ @runs = nil
18
+
19
+ update(data, **opts)
20
+ end
21
+
22
+ def update(data, **opts)
23
+ handle_names(data)
24
+ @venue = Venue.new(data['venue']) if data['venue']
25
+
26
+ @alias = data['abbr'] if data['abbr']
27
+ @runs = data['runs'].to_i if data['runs']
28
+ # # @home = data['home'] == 'true' if data['home']
29
+ # # @away = data['away'] == 'true' if data['away']
30
+ # # @scoring = data.dig('scoring', 'quarter') if data.dig('scoring', 'quarter')
31
+
32
+ parse_records(data) if data['win']
33
+ parse_players(data.dig('players'), opts[:game]) if data.dig('players')
34
+
35
+ # if opts[:game]
36
+ # opts[:game].update_from_team(id, "runs"=>6)
37
+ # opts[:game].update_from_team(id, "hits"=>11)
38
+ # opts[:game].update_from_team(id, "errors"=>1)
39
+ # opts[:game].update_from_team(id, "win"=>11)
40
+ # opts[:game].update_from_team(id, "loss"=>16)
41
+ # opts[:game].update_from_team(id, "probable_pitcher"=>{"jersey_number"=>"45", "id"=>"c1f19b5a-9dee-4053-9cad-ee4196f921e1", "win"=>2, "loss"=>3, "era"=>5.0})
42
+ # opts[:game].update_from_team(id, "starting_pitcher"=>{"last_name"=>"Cotton", "first_name"=>"Jharel", "preferred_name"=>"Jharel", "jersey_number"=>"45"})
43
+ # opts[:game].update_from_team(id, "current_pitcher"=>{"last_name"=>"Dull", "first_name"=>"Ryan", "preferred_name"=>"Ryan", "jersey_number"=>"66"})
44
+ # # add_game(opts[:game])
45
+ # # opts[:game].update_score(id => @runs) if @runs
46
+ # # opts[:game].update_stats(self, data['statistics']) if data['statistics']
47
+ # end
48
+ end
49
+ def handle_names(data)
50
+ # need to do some more work here
51
+ @name = data['name'] if data['name']
52
+ if data['name'] && data['market']
53
+ @market = data['market']
54
+ @full_name = [@market, data['name']].join(' ')
55
+ elsif data['name'] && !data.key?('market')
56
+ @full_name = data['name']
57
+ end
58
+ end
59
+
60
+ def record(type = 'overall')
61
+ @records[type]
62
+ end
63
+
64
+ def games
65
+ @games_hash.values
66
+ end
67
+ def add_game(game)
68
+ @games_hash[game.id] = game.id if game
69
+ end
70
+
71
+ def players
72
+ get_roster if @players_hash.empty?
73
+ @players_hash.values
74
+ end
75
+ alias :roster :players
76
+
77
+
78
+ # parsing response data
79
+
80
+ def parse_players(data, game)
81
+ create_data(@players_hash, data, klass: Player, api: api, team: self, game: game)
82
+ end
83
+ def update_player_stats(player, stats, game = nil)
84
+ game ? game.update_player_stats(player, stats) : @player_stats.merge!(player.id => stats.merge!(player: player))
85
+ end
86
+ def parse_records(data)
87
+ @records['overall'] = Record.new(data, type: 'overall')
88
+ end
89
+
90
+ def parse_season_stats(data)
91
+ @team_stats = data.dig('statistics')
92
+ update(data)
93
+ player_data = data.dig('players')
94
+ create_data(@players_hash, player_data, klass: Player, api: api, team: self)
95
+ data
96
+ end
97
+
98
+
99
+ # data retrieval
100
+
101
+ def get_roster
102
+ data = api.get_data(path_roster)
103
+ ingest_roster(data)
104
+ end
105
+ def ingest_roster(data)
106
+ update(data)
107
+ data
108
+ end
109
+ def queue_roster
110
+ url, headers, options, timeout = api.get_request_info(path_roster)
111
+ {url: url, headers: headers, params: options, timeout: timeout, callback: method(:ingest_roster)}
112
+ end
113
+
114
+ def get_season_stats(year = Date.today.year)
115
+ data = api.get_data(path_season_stats(year))
116
+ ingest_season_stats(data)
117
+ end
118
+ def ingest_season_stats(data)
119
+ parse_season_stats(data)
120
+ end
121
+ def queue_season_stats
122
+ url, headers, options, timeout = api.get_request_info(path_season_stats)
123
+ {url: url, headers: headers, params: options, timeout: timeout, callback: method(:ingest_season_stats)}
124
+ end
125
+
126
+ # url path helpers
127
+ def path_base
128
+ "teams/#{ id }"
129
+ end
130
+ def path_base_stats(season_year = api.default_year, default_season = api.default_season)
131
+ "seasontd/#{season_year}/#{default_season}/teams/#{id}"
132
+ end
133
+ def path_roster
134
+ "#{ path_base }/profile"
135
+ end
136
+ def path_season_stats(year)
137
+ "#{ path_base_stats(year) }/statistics"
138
+ end
139
+
140
+ def api
141
+ @api || Sportradar::Api::Baseball::Mlb.new
142
+ end
143
+
144
+ end
145
+ end
146
+ end
147
+ end
@@ -0,0 +1,50 @@
1
+ module Sportradar
2
+ module Api
3
+ module Baseball
4
+ class Venue < Data
5
+ attr_accessor :response, :id, :name, :address, :city, :state, :country, :zip, :capacity
6
+ @all_hash = {}
7
+ def self.new(data, **opts)
8
+ existing = @all_hash[data['id']]
9
+ if existing
10
+ existing.update(data, **opts)
11
+ existing
12
+ else
13
+ @all_hash[data['id']] = super
14
+ end
15
+ end
16
+ def self.all
17
+ @all_hash.values
18
+ end
19
+
20
+ def initialize(data, **opts)
21
+ @response = data
22
+ @id = data["id"]
23
+
24
+ update(data, **opts)
25
+ end
26
+ def update(data, **opts)
27
+ @name = data['name']
28
+ @address = data['address']
29
+ @city = data['city']
30
+ @state = data['state']
31
+ @zip = data['zip']
32
+ @country = data['country']
33
+ @capacity = data['capacity']
34
+
35
+ @surface = data['surface']
36
+
37
+ # dimensions
38
+ end
39
+
40
+ def location
41
+ "#{name}, #{city}"
42
+ end
43
+
44
+ KEYS_SCHEDULE = ["id", "name", "capacity", "address", "city", "state", "zip", "country"]
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ __END__
@@ -0,0 +1,45 @@
1
+ # require_relative 'baseball/season'
2
+ require_relative 'baseball/game'
3
+ require_relative 'baseball/outcome'
4
+ require_relative 'baseball/team'
5
+ require_relative 'baseball/record'
6
+ require_relative 'baseball/venue'
7
+ require_relative 'baseball/inning'
8
+ require_relative 'baseball/half_inning'
9
+ require_relative 'baseball/error'
10
+ require_relative 'baseball/fielder'
11
+ require_relative 'baseball/runner'
12
+ require_relative 'baseball/event'
13
+ require_relative 'baseball/events/at_bat'
14
+ require_relative 'baseball/events/lineup'
15
+ require_relative 'baseball/events/warming_up'
16
+ require_relative 'baseball/pitch'
17
+ require_relative 'baseball/player'
18
+ # require_relative 'baseball/broadcast'
19
+ # require_relative 'baseball/injury'
20
+ require_relative 'baseball/scoring'
21
+
22
+ require_relative 'baseball/mlb'
23
+ require_relative 'baseball/mlb/hierarchy'
24
+ require_relative 'baseball/mlb/league'
25
+ require_relative 'baseball/mlb/division'
26
+ # require_relative 'baseball/mlb/season'
27
+ # require_relative 'baseball/mlb/schedule'
28
+ # require_relative 'baseball/mlb/game'
29
+ # require_relative 'baseball/mlb/team'
30
+ # require_relative 'baseball/mlb/player'
31
+ # require_relative 'baseball/mlb/quarter'
32
+
33
+ # require_relative 'baseball/ncaamb'
34
+ # require_relative 'baseball/ncaamb/season'
35
+ # require_relative 'baseball/ncaamb/schedule'
36
+ # require_relative 'baseball/ncaamb/tournament'
37
+ # require_relative 'baseball/ncaamb/round'
38
+ # require_relative 'baseball/ncaamb/bracket'
39
+ # require_relative 'baseball/ncaamb/game'
40
+ # require_relative 'baseball/ncaamb/half'
41
+ # require_relative 'baseball/ncaamb/hierarchy'
42
+ # require_relative 'baseball/ncaamb/division'
43
+ # require_relative 'baseball/ncaamb/conference'
44
+ # require_relative 'baseball/ncaamb/team'
45
+ # require_relative 'baseball/ncaamb/player'
@@ -0,0 +1,13 @@
1
+ module Sportradar
2
+ module Api
3
+ class Broadcast < Data
4
+ attr_accessor :response, :network
5
+
6
+ def initialize(data)
7
+ @response = data
8
+ @network = data["network"]
9
+ end
10
+
11
+ end
12
+ end
13
+ end
@@ -46,7 +46,7 @@ module Sportradar
46
46
  existing
47
47
  end
48
48
 
49
- # @param existing [Hash{String=>Data}] Existing data hasb, ID => entity
49
+ # @param existing [Hash{String=>Data}] Existing data hash, ID => entity
50
50
  # @param data [Hash, Array] new data to update with
51
51
  def create_data(existing = {}, data, klass: nil, **opts)
52
52
  existing ||= {} # handles nil case, typically during object instantiation
@@ -1,5 +1,5 @@
1
1
  module Sportradar
2
2
  module Api
3
- VERSION = "0.10.13"
3
+ VERSION = "0.10.14"
4
4
  end
5
5
  end