module UndergroundWeather class DailyForecast attr_reader :day, :date, :high_f, :high_c, :low_f, :low_c, :conditions, :icon alias_method :high, :high_f alias_method :low, :low_f def initialize(forecast) @day = forecast['date']['weekday'] @date = Time.at(forecast['date']['epoch'].to_i) @high_f = forecast['high']['fahrenheit'] @high_c = forecast['high']['celsius'] @low_f = forecast['low']['fahrenheit'] @low_c = forecast['low']['celsius'] @conditions = forecast['conditions'] @icon = forecast['icon_url'] end end end