module TemperatureConverter
Constants
- VERSION
Public Instance Methods
c_to_f(x)
click to toggle source
# File lib/Temperature_Converter.rb, line 10 def c_to_f(x) x.to_i x *= (9/5) x += 32 end
c_to_k(x)
click to toggle source
# File lib/Temperature_Converter.rb, line 30 def c_to_k(x) x.to_i x += 273.15 end
f_to_c(x)
click to toggle source
# File lib/Temperature_Converter.rb, line 4 def f_to_c(x) x.to_i x -= 32 x *= (5/9) end
f_to_k(x)
click to toggle source
# File lib/Temperature_Converter.rb, line 16 def f_to_k(x) x.to_i x -= 32 x *= (5/9) x += 273.15 end
k_to_c(x)
click to toggle source
# File lib/Temperature_Converter.rb, line 35 def k_to_c(x) x.to_i x -= 273.15 end
k_to_f(x)
click to toggle source
# File lib/Temperature_Converter.rb, line 23 def k_to_f(x) x.to_i x -= 273.15 x *= (9/5) x += 32 end