Class: TemperatureRange
- Inherits:
-
Object
- Object
- TemperatureRange
- Defined in:
- lib/temperaturerange.rb
Instance Method Summary collapse
-
#initialize(base, high_adj, low_adj) ⇒ TemperatureRange
constructor
A new instance of TemperatureRange.
- #range(roller, record = nil) ⇒ Object
Constructor Details
#initialize(base, high_adj, low_adj) ⇒ TemperatureRange
Returns a new instance of TemperatureRange.
2 3 4 5 6 |
# File 'lib/temperaturerange.rb', line 2 def initialize (base, high_adj, low_adj) @base = base @high_adj = high_adj @low_adj = low_adj end |
Instance Method Details
#range(roller, record = nil) ⇒ Object
8 9 10 11 |
# File 'lib/temperaturerange.rb', line 8 def range (roller, record=nil) base = calculate_todays_base(record) (base - roller.roll(@low_adj[0], @low_adj[1])..base+ roller.roll(@high_adj[0], @high_adj[1])) end |