examples/forecast.rb in owmo-0.1.0 vs examples/forecast.rb in owmo-0.2.0
- old
+ new
@@ -1,18 +1,22 @@
require 'owmo'
+
+=begin rdoc
+An example on how to get the extended forcast and use the different parameters.
+=end
api_key = ""
OWMO::weather api_key: api_key do |weather|
# http://openweathermap.org/forecast5
- params = {
+ query = {
zip: "90210", # [city_name, city_id, zip, lat/lon]
mode: 'json', # [json, xml, html] Not required, but an option
units: 'imperial', # [imperial, metric] Not required, but an option
lang: 'en_US' # Not required, but an option
}
- forecast = weather.get :forecast, params
+ forecast = weather.get :forecast, query
puts forecast
end