def parse_complex_forecast(response)
      ret = {}

      response['forecast']['simpleforecast']['forecastday'].each do |f|
        date = f['date']
        ret[f['period'] - 1] = {
          date: DateTime.new(date['year'], date['month'], date['day'], date['hour'], date['min'].to_i, date['sec'], date['tz_short']),
          weekday_name: date['weekday'],
          high_f: f['high']['fahrenheit'].to_i,
          high_c: f['high']['celsius'].to_i,
          low_f: f['low']['fahrenheit'].to_i,
          low_c: f['low']['celsius'].to_i,
          conditions: f['conditions'].to_i,
          image_url: f['icon_url'],
          snow: {
            snow_total_in: f['snow_allday']['in'],
            snow_total_cm: f['snow_allday']['cm'],
            snow_night_in: f['snow_night']['in'],
            snow_night_cm: f['snow_night']['cm'],
            snow_day_in: f['snow_day']['in'],
            snow_day_cm: f['snow_day']['cm']
          },
          quantative_precipitation: {
            qpf_total_in: f['qpf_allday']['in'],
            qpf_total_cm: f['qpf_allday']['cm'],
            qpf_night_in: f['qpf_night']['in'],
            qpf_night_cm: f['qpf_night']['cm'],
            qpf_day_in: f['qpf_day']['in'],
            qpf_day_cm: f['qpf_day']['cm']
          },
          wind: {
            average_mph: f['avewind']['mph'],
            average_kph: f['avewind']['kph'],
            average_dir: f['avewind']['dir'],
            average_temp: f['avewind']['degrees'],
            max_mph: f['maxwind']['mph'],
            max_kph: f['maxwind']['kph'],
            max_dir: f['maxwind']['dir'],
            max_temp: f['maxwind']['degrees']
          }
        }
      end

      ret
    end
def parse_complex_forecast(response)
      ret = {}

      response['forecast']['simpleforecast']['forecastday'].each do |f|
        date = f['date']
        ret[f['period'] - 1] = {
          date: DateTime.new(date['year'], date['month'], date['day'], date['hour'], date['min'].to_i, date['sec'], date['tz_short']),
          weekday_name: date['weekday'],
          high_f: f['high']['fahrenheit'].to_i,
          high_c: f['high']['celsius'].to_i,
          low_f: f['low']['fahrenheit'].to_i,
          low_c: f['low']['celsius'].to_i,
          conditions: f['conditions'].to_i,
          image_url: f['icon_url'],
          snow: {
            snow_total_in: f['snow_allday']['in'],
            snow_total_cm: f['snow_allday']['cm'],
            snow_night_in: f['snow_night']['in'],
            snow_night_cm: f['snow_night']['cm'],
            snow_day_in: f['snow_day']['in'],
            snow_day_cm: f['snow_day']['cm']
          },
          quantative_precipitation: {
            qpf_total_in: f['qpf_allday']['in'],
            qpf_total_cm: f['qpf_allday']['cm'],
            qpf_night_in: f['qpf_night']['in'],
            qpf_night_cm: f['qpf_night']['cm'],
            qpf_day_in: f['qpf_day']['in'],
            qpf_day_cm: f['qpf_day']['cm']
          },
          wind: {
            average_mph: f['avewind']['mph'],
            average_kph: f['avewind']['kph'],
            average_dir: f['avewind']['dir'],
            average_temp: f['avewind']['degrees'],
            max_mph: f['maxwind']['mph'],
            max_kph: f['maxwind']['kph'],
            max_dir: f['maxwind']['dir'],
            max_temp: f['maxwind']['degrees']
          }
        }
      end

      ret
    end
Parses the complex forecast information.