Class: S44_MyWeatherForecast
- Inherits:
-
Object
- Object
- S44_MyWeatherForecast
- Defined in:
- lib/s44_myweatherforecast.rb
Instance Method Summary collapse
- #afternoon ⇒ Object (also: #this_afternoon)
- #ahead(advance = 2) ⇒ Object
- #early_hours ⇒ Object
- #evening ⇒ Object (also: #this_evening)
-
#initialize(myweatherforecast = nil) ⇒ S44_MyWeatherForecast
constructor
A new instance of S44_MyWeatherForecast.
- #morning ⇒ Object
- #tomorrow ⇒ Object
- #tonight ⇒ Object (also: #night)
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
#afternoon ⇒ Object 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_hours ⇒ Object
22 23 24 |
# File 'lib/s44_myweatherforecast.rb', line 22 def early_hours() summary :early_hours end |
#evening ⇒ Object Also known as: this_evening
30 31 32 |
# File 'lib/s44_myweatherforecast.rb', line 30 def evening() summary :evening end |
#morning ⇒ Object
26 27 28 |
# File 'lib/s44_myweatherforecast.rb', line 26 def morning summary :morning end |
#tomorrow ⇒ Object
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 |
#tonight ⇒ Object Also known as: night
44 45 46 |
# File 'lib/s44_myweatherforecast.rb', line 44 def tonight() summary :night end |