Sha256: 3a92154bd65b93f39865c77738b733324c7de1b9f97d017dcd4da3fd0237076b

Contents?: true

Size: 573 Bytes

Versions: 2

Compression:

Stored size: 573 Bytes

Contents

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

    # the date and time associated with these conditions.
    attr_reader :date

    # the temperature of the location.
    attr_reader :temp

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

    def initialize payload
      @code = payload[:code].to_i
      @date = Utils.parse_time payload[:date]
      @temp = payload[:temp].to_i
      @text = payload[:text]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
weather-api-1.1.1 lib/weather-api/condition.rb
weather-api-1.1.0 lib/weather-api/condition.rb