lib/barometer/measurements/measurement.rb in barometer-0.6.1 vs lib/barometer/measurements/measurement.rb in barometer-0.6.2

- old
+ new

@@ -1,12 +1,12 @@ module Barometer # # Measurement # a class that holds the response from a weather service # - # its main purpose is to hold all the data collected from a weather service - # as it is passed to the weather object + # its main purpose is to hold all the data collected from a single weather + # service as it is passed to the weather object # # this response includes # - current weather data (using the CurrentMeasurement class) # - forecasted weather data (an Array of instances of the ForecastMeasurement class) # - time_zone information (for the location in question) @@ -29,12 +29,12 @@ @weight = 1 @links = {} end def success! - current && current.temperature && - !current.temperature.c.nil? && @success = true + current && current.temperature && + !current.temperature.c.nil? && @success = true end def stamp!; @utc_time_stamp = Time.now.utc; end def success?; @success; end def metric?; @metric; end @@ -93,17 +93,17 @@ raise ArgumentError unless time.is_a?(Time) @utc_time_stamp = time end def current=(current) - raise ArgumentError unless current.is_a?(Measurement::Current) + raise ArgumentError unless current.is_a?(Measurement::Result) @current = current self.stamp! self.success! end def forecast=(forecast) - raise ArgumentError unless forecast.is_a?(Measurement::ForecastArray) + raise ArgumentError unless forecast.is_a?(Measurement::ResultArray) @forecast = forecast end def timezone=(timezone) return unless timezone \ No newline at end of file