Class: WillItRain::DataPoint
- Inherits:
-
Object
- Object
- WillItRain::DataPoint
- Defined in:
- lib/will_it_rain/data_point.rb
Instance Attribute Summary collapse
-
#percentage ⇒ Object
percentage refers to likelihood of precipitation.
-
#summary ⇒ Object
percentage refers to likelihood of precipitation.
Instance Method Summary collapse
-
#initialize(data_point) ⇒ DataPoint
constructor
A new instance of DataPoint.
- #surpasses_threshold?(threshold) ⇒ Boolean
Constructor Details
#initialize(data_point) ⇒ DataPoint
Returns a new instance of DataPoint.
6 7 8 9 |
# File 'lib/will_it_rain/data_point.rb', line 6 def initialize(data_point) self.percentage = (100 * data_point.precipProbability).round(2) self.summary = data_point.summary end |
Instance Attribute Details
#percentage ⇒ Object
percentage refers to likelihood of precipitation
4 5 6 |
# File 'lib/will_it_rain/data_point.rb', line 4 def percentage @percentage end |
#summary ⇒ Object
percentage refers to likelihood of precipitation
4 5 6 |
# File 'lib/will_it_rain/data_point.rb', line 4 def summary @summary end |
Instance Method Details
#surpasses_threshold?(threshold) ⇒ Boolean
11 12 13 |
# File 'lib/will_it_rain/data_point.rb', line 11 def surpasses_threshold?(threshold) percentage >= threshold end |