class Weather::Response
Attributes
a Weather::Astronomy
object containing sunrise and sunset information for the requested location
a Weather::Atmosphere
object containing the atmosphere information for the requested location
a Weather::Condition
object detailing the current conditions of the requested location
the HTML summarizing current weather conditions for the requested location
a collection of Weather::Forecast
objects containing high-level forecasted weather for upcoming days
a Weather::Image
object containing an image icon representing the current weather for the requested location
the latitude for the requested location
a Weather::Location
object containing the geographical names of the requested location
the longitude for the requested location
the location string initially requested of the service.
the url with which the Yahoo! Weather
service was accessed to build the response
the title of the weather information for the requested location
a Weather::Units
object containig the units corresponding to the information contained in the response
a Weather::Wind
object containing the wind information for the requested location
Public Class Methods
# File lib/weather-api/response.rb, line 55 def initialize(request_location, request_url, doc) # save the request params @request_location = request_location @request_url = request_url @astronomy = Astronomy.new doc[:astronomy] @location = Location.new doc[:location] @units = Units.new doc[:units] @wind = Wind.new doc[:wind] @atmosphere = Atmosphere.new doc[:atmosphere] @image = Image.new doc[:item][:description] @forecasts = [] @condition = Condition.new doc[:item][:condition] doc[:item][:forecast].each do |forecast| @forecasts << Forecast.new(forecast) end @latitude = doc[:item][:lat].to_f @longitude = doc[:item][:long].to_f @title = doc[:item][:title].strip @description = doc[:item][:description].strip end