Class: MyWeatherForecast::Day

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

Instance Method Summary collapse

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

#summaryObject



41
42
43
# File 'lib/myweatherforecast.rb', line 41

def summary()
  @x.summary
end

#temperatureObject



45
46
47
# File 'lib/myweatherforecast.rb', line 45

def temperature
  @x.temperature
end

#to_sObject



37
38
39
# File 'lib/myweatherforecast.rb', line 37

def to_s
  "%s %s, %s" % [@x.temperature.round, @tlabel, @x.summary]
end