Sha256: e46125b8cbe9ccd64397ad56390798ca0e8845cd6197a121b35808ee84a867ad

Contents?: true

Size: 418 Bytes

Versions: 2

Compression:

Stored size: 418 Bytes

Contents

module UndergroundWeather
  class Forecast
    attr_reader :sunday, :monday, :tuesday, :wednesday, :thursday, :friday, :saturday
    
    def initialize(feed)
      days = []
      feed['forecast']['simpleforecast']['forecastday'].each do |daily|
        days << DailyForecast.new(daily)
      end  
      
      days.each do |d|
        instance_variable_set("@#{d.day.downcase}", d)
      end  
    end 
  end  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
undergroundweather-0.0.3 lib/undergroundweather/features/forecast.rb
undergroundweather-0.0.2 lib/undergroundweather/features/forecast.rb