Class: MyWeatherForecast::Day
- Inherits:
-
Object
- Object
- MyWeatherForecast::Day
- Defined in:
- lib/myweatherforecast.rb
Instance Method Summary collapse
-
#initialize(x, tlabel) ⇒ Day
constructor
A new instance of Day.
- #summary ⇒ Object
- #temperature ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(x, tlabel) ⇒ Day
Returns a new instance of Day.
30 31 32 33 34 35 |
# File 'lib/myweatherforecast.rb', line 30 def initialize(x, tlabel) @x = x @tlabel = tlabel end |
Instance Method Details
#summary ⇒ Object
41 42 43 |
# File 'lib/myweatherforecast.rb', line 41 def summary() @x.summary end |
#temperature ⇒ Object
45 46 47 |
# File 'lib/myweatherforecast.rb', line 45 def temperature @x.temperature end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/myweatherforecast.rb', line 37 def to_s "%s %s, %s" % [@x.temperature.round, @tlabel, @x.summary] end |