class CrystalWeather::API
- CrystalWeather::API
- Reference
- Object
Overview
API
is the interface that allows caller to interact with OpenWeatherMap's API
Defined in:
api.crConstructors
-
.new(api_key : String, lang : String, units_format : String)
Creates a new
API
object.
Instance Method Summary
-
#current(location : String) : Types::Current
Fetches the current weather for a specific location
-
#forecast(location : String) : Types::Forecast
Fetches the forecast for a specific location
-
#lang : String
Choosen lang between : ar, bg, ca, cz, de, el, fa, fi, fr, gl, hr, hu, it, ja, kr, la, lt, mk, nl, pl, pt, ro, ru, se, sk, sl, es, tr, ua, vi, zh_cn, zh_tw, en.
-
#raw_current(location : String) : JSON::Any
Gets the raw data of the current weather for a specific location
-
#raw_forecast(location : String) : JSON::Any
Gets the raw data of the forecast for a specific location
-
#units_format : String
Choosen units format between : default, metric or imperial
Constructor Detail
Creates a new API
object. Please make sure that :
- you created an api_key on OpenWeatherMap's website
- the lang you choose is valid
- the units_format format you choose is valid
Instance Method Detail
Fetches the current weather for a specific location
Choosen lang between : ar, bg, ca, cz, de, el, fa, fi, fr, gl, hr, hu, it, ja, kr, la, lt, mk, nl, pl, pt, ro, ru, se, sk, sl, es, tr, ua, vi, zh_cn, zh_tw, en.
Gets the raw data of the current weather for a specific location
Gets the raw data of the forecast for a specific location