- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
def self.check
check = ENV['BATTLE_NET_KEY'].nil? || ENV['BATTLE_NET_REGION'].nil? || ENV['BATTLE_NET_LOCALE'].nil?
message = 'Env variables missing:' if check
message += " ENV['BATTLE_NET_KEY']" if ENV['BATTLE_NET_KEY'].nil?
message += " ENV['BATTLE_NET_REGION']" if ENV['BATTLE_NET_REGION'].nil?
message += " ENV['BATTLE_NET_LOCALE']" if ENV['BATTLE_NET_LOCALE'].nil?
check ? message : true
end
def self.call_api(remote_url)
if check == true
encoded_url = URI.encode(remote_url)
response = HTTParty.get(encoded_url)
JSON.parse(response.body)
else
check
end
end
Комментарии (0) RSS
Добавить комментарий