Class: GeekWeather::CLI
- Inherits:
-
Thor
- Object
- Thor
- GeekWeather::CLI
- Defined in:
- lib/geek_weather/cli.rb
Instance Method Summary collapse
Instance Method Details
#forecast(days_offset = 0) ⇒ Object
11 12 13 14 15 |
# File 'lib/geek_weather/cli.rb', line 11 def forecast(days_offset=0) ENV['WUNDERGROUND_API_KEY'] = [:api_key] if .has_key?("api_key")#"d5343d7f721568c4" day_forecast = Forecast.new.call(country_code: [:country_code], city_name: [:city_name], forecast_offset: days_offset.to_i) print day_forecast.to_s end |
#forecast_icon(days_offset = 0) ⇒ Object
21 22 23 24 25 |
# File 'lib/geek_weather/cli.rb', line 21 def forecast_icon(days_offset=0) ENV['WUNDERGROUND_API_KEY'] = [:api_key] if .has_key?("api_key")#"d5343d7f721568c4" day_forecast = Forecast.new.call(country_code: [:country_code], city_name: [:city_name], forecast_offset: days_offset.to_i) print day_forecast.icon_url end |