Sha256: 6f9d2f2454c20d53b45e57997f40b5bb5a8eb29dc437c8c7d3a54dc158feeb38

Contents?: true

Size: 765 Bytes

Versions: 2

Compression:

Stored size: 765 Bytes

Contents

module Weather
  class Forecast
    # the brief name of the day associated with the forecast
    attr_reader :day

    # the date associated with the forecast.
    attr_reader :date

    # the low temperature forecasted.
    attr_reader :low

    # the high temperature forecasted.
    attr_reader :high

    # the brief prose text description of the forecasted weather conditions.
    attr_reader :text

    # the weather condition code, detailed at http://developer.yahoo.com/weather
    attr_reader :code

    def initialize(payload)
      @day  = payload[:day].strip
      @date = Utils.parse_time payload[:date]
      @low  = payload[:low].to_i
      @high = payload[:high].to_i
      @text = payload[:text]
      @code = payload[:code].to_i
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
weather-api-1.4.0 lib/weather-api/forecast.rb
weather-api-1.3.0 lib/weather-api/forecast.rb