Sha256: b9d88ed7f1d887116ff30cffc278c07655cfb03dfccdaab2f649caf54dfd73a7
Contents?: true
Size: 360 Bytes
Versions: 1
Compression:
Stored size: 360 Bytes
Contents
require "httparty" require 'dotenv' module WeatherUganda class WeatherFetcher API_URL = "http://api.weatherapi.com/v1" API_KEY = ENV["WEATHER_API"] def self.get_weather(location) response = HTTParty.get(API_URL, query: { q: location, appid: API_KEY, units: "metric" }) response.parsed_response if response.success? end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
weather_uganda-0.1.1 | lib/weather_uganda/weather_fetcher.rb |