Sha256: 37386f254ab8ae3d610c93e28fd740809832f6b11e6ac6e5b1b8d8c03db77d31
Contents?: true
Size: 894 Bytes
Versions: 17
Compression:
Stored size: 894 Bytes
Contents
module Sportradar module Api module Odds class Sport < Data attr_accessor :response, :api, :id, :name, :type def initialize(data, **opts) @response = data @api = opts[:api] @id = data['id'] @name = data['name'] @type = data['type'] @competitions_hash = {} end def update(data, **opts) end def competitions @competitions_hash.values end def get_competitions data = api.get_data(path_competitions); create_data(@competitions_hash, data['competitions'], klass: Sport, api: api) data end # url path helpers def path_base "sports/#{id}" end def path_competitions "#{path_base}/competitions" end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems