Class: WeatherGuy::Conversion
- Inherits:
-
Object
- Object
- WeatherGuy::Conversion
- Defined in:
- lib/weather_guy.rb
Instance Method Summary collapse
Instance Method Details
#c_to_f(c_temp) ⇒ Object
13 14 15 |
# File 'lib/weather_guy.rb', line 13 def c_to_f(c_temp) 9 / 5 * (c_temp.to_i + 32) end |
#c_to_k(c_temp) ⇒ Object
17 18 19 |
# File 'lib/weather_guy.rb', line 17 def c_to_k(c_temp) c_temp.to_i + 273.15 end |
#f_to_c(f_temp) ⇒ Object
5 6 7 |
# File 'lib/weather_guy.rb', line 5 def f_to_c(f_temp) (f_temp.to_i - 32) * 5 / 9 end |
#f_to_k(f_temp) ⇒ Object
9 10 11 |
# File 'lib/weather_guy.rb', line 9 def f_to_k(f_temp) (f_temp.to_i + 459.67) * 5 / 9 end |