Class: YahooWeather::Condition

Inherits:
Object
  • Object
show all
Defined in:
lib/yahoo-weather.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ Condition

Returns a new instance of Condition.



134
135
136
137
138
139
# File 'lib/yahoo-weather.rb', line 134

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

Instance Attribute Details

#codeObject (readonly)

the Yahoo! Weather condition code, as detailed at developer.yahoo.com/weather.



123
124
125
# File 'lib/yahoo-weather.rb', line 123

def code
  @code
end

#dateObject (readonly)

the date and time associated with these conditions.



126
127
128
# File 'lib/yahoo-weather.rb', line 126

def date
  @date
end

#tempObject (readonly)

the temperature of the location.



129
130
131
# File 'lib/yahoo-weather.rb', line 129

def temp
  @temp
end

#textObject (readonly)

the brief prose text description of the weather conditions of the location.



132
133
134
# File 'lib/yahoo-weather.rb', line 132

def text
  @text
end