Class: Eltiempo::EltiempoCLI
- Inherits:
-
Thor
- Object
- Thor
- Eltiempo::EltiempoCLI
- Defined in:
- lib/eltiempo/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
- #av_max(city) ⇒ Object
- #av_min(city) ⇒ Object
-
#initialize(*args) ⇒ EltiempoCLI
constructor
A new instance of EltiempoCLI.
- #today(city) ⇒ Object
Constructor Details
#initialize(*args) ⇒ EltiempoCLI
Returns a new instance of EltiempoCLI.
7 8 9 10 |
# File 'lib/eltiempo/cli.rb', line 7 def initialize(*args) super config end |
Class Method Details
.exit_on_failure? ⇒ Boolean
12 13 14 |
# File 'lib/eltiempo/cli.rb', line 12 def self.exit_on_failure? true end |
Instance Method Details
#av_max(city) ⇒ Object
22 23 24 |
# File 'lib/eltiempo/cli.rb', line 22 def av_max city puts "Average maximum temperature of the week in #{city} " + @eltiempoparser.average_temp(city, "max").to_s + "º" end |
#av_min(city) ⇒ Object
27 28 29 |
# File 'lib/eltiempo/cli.rb', line 27 def av_min city puts "Average maximum temperature of the week in #{city} " + @eltiempoparser.average_temp(city, "min").to_s + "º" end |
#today(city) ⇒ Object
17 18 19 |
# File 'lib/eltiempo/cli.rb', line 17 def today city puts "Temperature in #{city} " + @eltiempoparser.today_temp(city).to_s end |