module WillItRain class DataPoint # percentage refers to likelihood of precipitation attr_accessor :percentage, :summary def initialize(data_point) self.percentage = (100 * data_point.precipProbability).round(2) self.summary = data_point.summary end def surpasses_threshold?(threshold) percentage >= threshold end end end