Class: MyWeatherForecast
- Inherits:
-
Object
- Object
- MyWeatherForecast
- Defined in:
- lib/myweatherforecast.rb
Overview
This gem is a wrapper of the forecast_io gem SI explained: en.wikipedia.org/wiki/SI_derived_unit
Defined Under Namespace
Instance Method Summary collapse
-
#initialize(lat, lon, api_key: nil, si: true) ⇒ MyWeatherForecast
constructor
A new instance of MyWeatherForecast.
- #today ⇒ Object
- #tomorrow ⇒ Object
Constructor Details
#initialize(lat, lon, api_key: nil, si: true) ⇒ MyWeatherForecast
Returns a new instance of MyWeatherForecast.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/myweatherforecast.rb', line 12 def initialize(lat, lon, api_key: nil, si: true) ForecastIO.api_key = api_key if si then params = { units: 'si' } @tlabel = 'degrees Celcius' else params = {} @tlabel = 'degrees Farenheit' end @forecast = ForecastIO.forecast(lat, lon, params: params) end |