Module: IStats::Utils
Instance Method Summary collapse
-
#abs_thresholds(scale, max_value) ⇒ Object
Produce a thresholds array containing absolute values based on supplied percentages applied to a literal max value.
-
#to_fahrenheit(temperature) ⇒ Object
Converts a temperature value in celcius to fahrenheit.
Instance Method Details
#abs_thresholds(scale, max_value) ⇒ Object
Produce a thresholds array containing absolute values based on supplied percentages applied to a literal max value.
15 16 17 18 19 20 21 |
# File 'lib/iStats/utils.rb', line 15 def abs_thresholds(scale, max_value) at = [] scale.each { |v| at.push(v * max_value) } return at end |
#to_fahrenheit(temperature) ⇒ Object
Converts a temperature value in celcius to fahrenheit.
Returns the temperature in fahrenheit.
8 9 10 |
# File 'lib/iStats/utils.rb', line 8 def to_fahrenheit(temperature) (temperature * (9.0 / 5.0)) + 32 end |