Sha256: 46409abe263e6028e58833fe0e84dd37f4397c7ca9d5d6dee6cee3ea03a9449b
Contents?: true
Size: 1.46 KB
Versions: 23
Compression:
Stored size: 1.46 KB
Contents
require_relative 'soccer/api' require_relative 'soccer/group' require_relative 'soccer/tournament' require_relative 'soccer/competition' require_relative 'soccer/standing' require_relative 'soccer/team_group' require_relative 'soccer/season' require_relative 'soccer/match' require_relative 'soccer/event' require_relative 'soccer/lineup' require_relative 'soccer/team' require_relative 'soccer/player' require_relative 'soccer/venue' require_relative 'soccer/fact' require_relative 'soccer/scoring' module Sportradar module Api module Soccer def self.parse_results(arr) arr.map { |hash| hash["sport_event"].merge(hash["sport_event_status"]) } end def self.get_competitions data = api.get_data(path_competitions).to_h parse_competitions(data) end def self.parse_competitions(data) if data['competitions'] data['competitions'].map do |hash| Competition.new(hash, api: api) end end end def self.api @api ||= Sportradar::Api::Soccer::Api.new end # url path helpers def self.path_competitions "competitions" end end end end __END__ comps = Sportradar::Api::Soccer.get_competitions; comp = comps.detect { |comp| comp.id == 'sr:competition:27466' } comp = comps.third; comp.get_seasons; season = comp.seasons.last; resp = season.get_schedule; season.matches.size; match = season.matches.first; data = match.get_summary
Version data entries
23 entries across 23 versions & 1 rubygems
Version | Path |
---|---|
sportradar-api-0.17.1 | lib/sportradar/api/soccer.rb |
sportradar-api-0.17.0 | lib/sportradar/api/soccer.rb |
sportradar-api-0.17.0.pre | lib/sportradar/api/soccer.rb |