lib/sportradar/api/nfl.rb in sportradar-api-0.1.19 vs lib/sportradar/api/nfl.rb in sportradar-api-0.1.21
- old
+ new
@@ -7,11 +7,10 @@
@league = "nfl"
raise Sportradar::Api::Error::InvalidAccessLevel unless allowed_access_levels.include? access_level
@access_level = access_level
end
-
def schedule(year = Date.today.year, season = "reg")
raise Sportradar::Api::Error::InvalidSeason unless allowed_seasons.include? season
response = get request_url("games/#{ year }/#{ season }/schedule")
Sportradar::Api::Nfl::Season.new response["season"] if response.success? && response["season"]
end
@@ -93,10 +92,14 @@
def request_url(path)
"/nfl-#{access_level}#{version}/#{path}"
end
def api_key
- Sportradar::Api.api_key_params("nfl")
+ if access_level == 'o'
+ Sportradar::Api.api_key_params("nfl", "production")
+ else
+ Sportradar::Api.api_key_params("nfl")
+ end
end
def version
Sportradar::Api.version("nfl")
end