Class: Eltiempo::EltiempoCLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/eltiempo/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

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

Returns:

  • (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