lib/barometer/weather_services/weather_bug.rb in barometer-0.6.1 vs lib/barometer/weather_services/weather_bug.rb in barometer-0.6.2
- old
+ new
@@ -95,11 +95,11 @@
end
def self._build_current(data, metric=true)
raise ArgumentError unless data.is_a?(Hash)
- current = Measurement::Current.new
+ current = Measurement::Result.new
# current.updated_at = Data::LocalDateTime.parse(data['observation_time']) if data['observation_time']
current.humidity = data['aws:humidity'].to_i
current.condition = data['aws:current_condition'] if data['aws:current_condition']
current.icon = data['aws:icon'].to_i.to_s if data['aws:icon']
@@ -122,16 +122,16 @@
current
end
def self._build_forecast(data, metric=true)
raise ArgumentError unless data.is_a?(Hash)
- forecasts = Measurement::ForecastArray.new
+ forecasts = Measurement::ResultArray.new
# go through each forecast and create an instance
if data && data["aws:forecast"]
start_date = Date.parse(data['date'])
i = 0
data["aws:forecast"].each do |forecast|
- forecast_measurement = Measurement::Forecast.new
+ forecast_measurement = Measurement::Result.new
icon_match = forecast['aws:image'].match(/cond(\d*)\.gif$/)
forecast_measurement.icon = icon_match[1].to_i.to_s if icon_match
forecast_measurement.date = start_date + i
forecast_measurement.condition = forecast['aws:short_prediction']
\ No newline at end of file