Class: TemperatureConvertToFahrenheit
- Inherits:
-
Object
- Object
- TemperatureConvertToFahrenheit
- Defined in:
- lib/temperature_convert_to_fahrenheit.rb
Constant Summary collapse
- FAHRENHEIT_OFFSET =
32- FAHRENHEIT_SLOPE =
Rational(9,5)
Instance Attribute Summary collapse
-
#temp ⇒ Object
readonly
Returns the value of attribute temp.
Class Method Summary collapse
-
.to_fahrenheit(temp) ⇒ Object
——————————————————————— converting.
Instance Attribute Details
#temp ⇒ Object (readonly)
Returns the value of attribute temp.
5 6 7 |
# File 'lib/temperature_convert_to_fahrenheit.rb', line 5 def temp @temp end |
Class Method Details
.to_fahrenheit(temp) ⇒ Object
converting
11 12 13 |
# File 'lib/temperature_convert_to_fahrenheit.rb', line 11 def self.to_fahrenheit(temp) (temp.to_f * FAHRENHEIT_SLOPE) + FAHRENHEIT_OFFSET end |