Class: S44_MyWeatherForecast

Inherits:
Object
  • Object
show all
Defined in:
lib/s44_myweatherforecast.rb

Instance Method Summary collapse

Constructor Details

#initialize(myweatherforecast = nil) ⇒ S44_MyWeatherForecast

Returns a new instance of S44_MyWeatherForecast.



8
9
10
# File 'lib/s44_myweatherforecast.rb', line 8

def initialize(myweatherforecast=nil)
  @w = myweatherforecast
end

Instance Method Details

#afternoonObject Also known as: this_afternoon



12
13
14
# File 'lib/s44_myweatherforecast.rb', line 12

def afternoon()
  summary :afternoon
end

#ahead(advance = 2) ⇒ Object



16
17
18
# File 'lib/s44_myweatherforecast.rb', line 16

def ahead(advance=2)
  self.method(@w.today.ahead(advance)).call
end

#early_hoursObject



22
23
24
# File 'lib/s44_myweatherforecast.rb', line 22

def early_hours()
  summary :early_hours
end

#eveningObject Also known as: this_evening



30
31
32
# File 'lib/s44_myweatherforecast.rb', line 30

def evening()
  summary :evening
end

#morningObject



26
27
28
# File 'lib/s44_myweatherforecast.rb', line 26

def morning
  summary :morning
end

#tomorrowObject



36
37
38
39
40
41
42
# File 'lib/s44_myweatherforecast.rb', line 36

def tomorrow()
  
  s = @w.tomorrow.to_s
  min, max, desc = s.match(/\w+:\s+([^ ]+) ([^,]+),\s+(.*)\.$/).captures    
  outlook('tomorrow', min, max, desc: desc)
  
end

#tonightObject Also known as: night



44
45
46
# File 'lib/s44_myweatherforecast.rb', line 44

def tonight()
  summary :night
end