Class: Accuweather::Conditions::ForecastDay
- Inherits:
-
Object
- Object
- Accuweather::Conditions::ForecastDay
- Defined in:
- lib/accuweather/conditions/forecast_day.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#day_of_week ⇒ Object
readonly
Returns the value of attribute day_of_week.
-
#daytime ⇒ Object
readonly
Returns the value of attribute daytime.
-
#nighttime ⇒ Object
readonly
Returns the value of attribute nighttime.
-
#sunrise ⇒ Object
readonly
Returns the value of attribute sunrise.
-
#sunset ⇒ Object
readonly
Returns the value of attribute sunset.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(date:, day_of_week:, sunrise:, sunset:, daytime:, nighttime:) ⇒ ForecastDay
constructor
A new instance of ForecastDay.
- #to_s ⇒ Object
Constructor Details
#initialize(date:, day_of_week:, sunrise:, sunset:, daytime:, nighttime:) ⇒ ForecastDay
Returns a new instance of ForecastDay.
6 7 8 9 10 11 12 13 |
# File 'lib/accuweather/conditions/forecast_day.rb', line 6 def initialize(date:, day_of_week:, sunrise:, sunset:, daytime:, nighttime:) @date = date @day_of_week = day_of_week @sunrise = sunrise @sunset = sunset @daytime = daytime @nighttime = nighttime end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
4 5 6 |
# File 'lib/accuweather/conditions/forecast_day.rb', line 4 def date @date end |
#day_of_week ⇒ Object (readonly)
Returns the value of attribute day_of_week.
4 5 6 |
# File 'lib/accuweather/conditions/forecast_day.rb', line 4 def day_of_week @day_of_week end |
#daytime ⇒ Object (readonly)
Returns the value of attribute daytime.
4 5 6 |
# File 'lib/accuweather/conditions/forecast_day.rb', line 4 def daytime @daytime end |
#nighttime ⇒ Object (readonly)
Returns the value of attribute nighttime.
4 5 6 |
# File 'lib/accuweather/conditions/forecast_day.rb', line 4 def nighttime @nighttime end |
#sunrise ⇒ Object (readonly)
Returns the value of attribute sunrise.
4 5 6 |
# File 'lib/accuweather/conditions/forecast_day.rb', line 4 def sunrise @sunrise end |
#sunset ⇒ Object (readonly)
Returns the value of attribute sunset.
4 5 6 |
# File 'lib/accuweather/conditions/forecast_day.rb', line 4 def sunset @sunset end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/accuweather/conditions/forecast_day.rb', line 15 def ==(other) date == other.date && day_of_week == other.day_of_week && sunrise == other.sunrise && sunset == other.sunset && daytime == other.daytime && nighttime == other.nighttime rescue NoMethodError false end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/accuweather/conditions/forecast_day.rb', line 26 def to_s "date: #{date}, day_of_week: #{day_of_week}, sunrise: #{sunrise}, sunset: #{sunset}, daytime: #{daytime}, nighttime: #{nighttime}" end |