class Eltiempo::EltiempoCLI
Public Class Methods
exit_on_failure?()
click to toggle source
# File lib/eltiempo/cli.rb, line 12 def self.exit_on_failure? true end
new(*args)
click to toggle source
Calls superclass method
# File lib/eltiempo/cli.rb, line 7 def initialize(*args) super config end
Public Instance Methods
av_max(city)
click to toggle source
# 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)
click to toggle source
# File lib/eltiempo/cli.rb, line 27 def av_min city puts "Average minimun temperature of the week in #{city} " + @eltiempoparser.average_temp(city, "min").to_s + "º" end
cities()
click to toggle source
# File lib/eltiempo/cli.rb, line 32 def cities puts @eltiempoparser.all_cities end
today(city)
click to toggle source
# File lib/eltiempo/cli.rb, line 17 def today city puts "Temperature in #{city} " + @eltiempoparser.today_temp(city).to_s end
Private Instance Methods
config()
click to toggle source
# File lib/eltiempo/cli.rb, line 38 def config @eltiempoparser = EltiempoParser.new end