Class: WeatherData::Temperature::Fahrenheit
- Inherits:
-
Base
- Object
- Base
- WeatherData::Temperature::Fahrenheit
show all
- Defined in:
- lib/weather_data/temperature/fahrenheit.rb
Instance Attribute Summary
Attributes inherited from Base
#degrees
Instance Method Summary
collapse
Methods inherited from Base
#*, #+, #-, #-@, #/, #<=>, #==, #initialize, #to_f, #to_i
Instance Method Details
#to_celsius ⇒ Object
6
7
8
|
# File 'lib/weather_data/temperature/fahrenheit.rb', line 6
def to_celsius
Celsius.new((degrees - 32) * 5.0 / 9)
end
|
#to_fahrenheit ⇒ Object
10
11
12
|
# File 'lib/weather_data/temperature/fahrenheit.rb', line 10
def to_fahrenheit
self
end
|
#to_kelvin ⇒ Object
14
15
16
|
# File 'lib/weather_data/temperature/fahrenheit.rb', line 14
def to_kelvin
to_celsius.to_kelvin
end
|
#to_s ⇒ Object
18
19
20
|
# File 'lib/weather_data/temperature/fahrenheit.rb', line 18
def to_s
"#{degrees}°F"
end
|