Sha256: afa4f0eab2e136d68ccfb3b9cf251bfb05509c3f713315f3cfbb123f32fbbb66
Contents?: true
Size: 1.11 KB
Versions: 2
Compression:
Stored size: 1.11 KB
Contents
require 'pry' require 'thor' require_relative "./forecast" module GeekWeather class CLI < Thor option :api_key, required: false, type: :string option :country_code, required: true, type: :string option :city_name, required: true, type: :string desc "forecast DAYS_OFFSET", "Show weather forecast." def forecast(days_offset=0) ENV['WUNDERGROUND_API_KEY'] = options[:api_key] if options.has_key?("api_key")#"d5343d7f721568c4" day_forecast = Forecast.new.call(country_code: options[:country_code], city_name: options[:city_name], forecast_offset: days_offset.to_i) print day_forecast.to_s end option :api_key, required: false, type: :string option :country_code, required: true, type: :string option :city_name, required: true, type: :string desc "forecast_icon DAYS_OFFSET", "Show weather forecast." def forecast_icon(days_offset=0) ENV['WUNDERGROUND_API_KEY'] = options[:api_key] if options.has_key?("api_key")#"d5343d7f721568c4" day_forecast = Forecast.new.call(country_code: options[:country_code], city_name: options[:city_name], forecast_offset: days_offset.to_i) print day_forecast.icon_url end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
geek_weather-0.1.1 | lib/geek_weather/cli.rb |
geek_weather-0.1.0 | lib/geek_weather/cli.rb |