lib/sportradar/api.rb in sportradar-api-0.11.0 vs lib/sportradar/api.rb in sportradar-api-0.11.1
- old
+ new
@@ -98,10 +98,10 @@
def self.api_key_params(api, access_level = 'trial')
{ api_key: self.api_key(api, access_level) }
end
def self.api_key(api, access_level = 'trial')
- ENV.fetch("SPORTRADAR_#{api.to_s.upcase.gsub('-', '_')}#{'_PRODUCTION' if access_level == 'production'}", "api_key missing for #{api}")
+ ENV.fetch("SPORTRADAR_#{api.to_s.upcase.gsub('-', '_')}#{"_#{access_level.upcase}" if access_level != 'trial'}", "api_key missing for #{api}")
end
def self.version(api)
find_api = API_GALLERY.find{ |x| x[:api] == api.downcase.to_sym }
!find_api.nil? ? find_api[:version] : "version missing for #{api}"