lib/sportradar/api.rb in sportradar-api-0.15.0 vs lib/sportradar/api.rb in sportradar-api-0.15.1

- old
+ new

@@ -81,10 +81,14 @@ 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('-', '_')}#{"_#{access_level.upcase}" if access_level != 'trial'}", "api_key missing for #{api}") + ENV.fetch("SPORTRADAR_#{api.to_s.upcase.gsub('-', '_')}#{"_#{access_level.upcase}" if access_level != 'trial'}", + ENV.fetch("SPORTRADAR_#{api.to_s.upcase}_API_KEY", + "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}"