Sha256: b9739fd7a3c00373ecf3aba8bec9c8a76ed5ca90da236c80f9d6145759c3eda7

Contents?: true

Size: 336 Bytes

Versions: 10

Compression:

Stored size: 336 Bytes

Contents

class YahooWeather::Condition
  attr_reader :text, :temp, :date

  def initialize(payload)
    @text = payload['text']
    @code = payload['code'].to_i
    @temp = payload['temp'].to_i
    @date = Time.parse(payload['date'])
  end

  def code(u='integer')
    return @code if u == 'integer'
    YahooWeather.code_string(@code)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
yahoo_weather-1.1.1 lib/yahoo_weather/condition.rb
yahoo_weather-1.1.0 lib/yahoo_weather/condition.rb
yahoo_weather-1.0.7 lib/yahoo_weather/condition.rb
yahoo_weather-1.0.6 lib/yahoo_weather/condition.rb
yahoo_weather-1.0.5 lib/yahoo_weather/condition.rb
yahoo_weather-1.0.4 lib/yahoo_weather/condition.rb
yahoo_weather-1.0.3 lib/yahoo_weather/condition.rb
yahoo_weather-1.0.2 lib/yahoo_weather/condition.rb
yahoo_weather-1.0.1 lib/yahoo_weather/condition.rb
yahoo_weather-1.0.0 lib/yahoo_weather/condition.rb