lib/sportradar/api/football/ncaafb/game.rb in sportradar-api-0.11.0 vs lib/sportradar/api/football/ncaafb/game.rb in sportradar-api-0.11.1
- old
+ new
@@ -3,22 +3,22 @@
module Football
class Ncaafb
class Game < Sportradar::Api::Football::Game
def initialize(data, **opts)
- if data['uri']
- @year, @type, @week_number, @away_alias, @home_alias = data['uri'].split('/')
+ if data['id'].include?('/')
+ @year, @type, @week_number, @away_alias, @home_alias = data.delete('id').split('/')
end
super
end
def path_base
"#{ year }/#{ type }/#{ week_number.to_s }/#{ away_alias }/#{ home_alias }"
end
def generate_title
- if home && away
+ if home.full_name && away.full_name
"#{home.full_name} vs #{away.full_name}"
elsif home_alias && away_alias
"#{home_alias} vs #{away_alias}"
end
end
@@ -29,9 +29,14 @@
def get_extended_box
data = api.get_data(path_extended_box).to_h
ingest_extended_box(data)
+ end
+
+ def queue_extended_box
+ url, headers, options, timeout = api.get_request_info(path_extended_box)
+ {url: url, headers: headers, params: options, timeout: timeout, callback: method(:ingest_extended_box)}
end
def ingest_extended_box(data)
data = data
update(data, source: :extended_box)