Калоян обнови решението на 16.10.2016 14:51 (преди около 9 години)
+FORMULAS = {
+  'CF' => ->(degrees) { return (1.8 * degrees) + 32 },
+  'FC' => -> (degrees) { return (degrees - 32) / 1.8 },
+  'CK' => -> (degrees) { return degrees + 273.15 },
+  'KC' => -> (degrees) { return degrees - 273.15 },
+  'KF' => -> (degrees) { return FORMULAS['CF'].call(degrees - 273.15) },
+  'FK' => -> (degrees) { return (degrees - 32) / 1.8 + 273.15 },
+  'CC' => -> (degrees) { return degrees },
+  'KK' => -> (degrees) { return degrees },
+  'FF' => -> (degrees) { return degrees }
+}.freeze
Сложи един нов ред.
Тези return-и са излишни.
+TEMPERATURES = {
+  'water' => [0, 100],
+  'ethanol' => [-114, 78.37],
+  'gold' => [1064, 2700],
+  'silver' => [961.8, 2162],
+  'copper' => [1085, 2567]
+}.freeze
Сложи един нов ред.
+def convert_between_temperature_units(input_degrees, input_unit, output_unit)
+  FORMULAS[input_unit + output_unit].call(input_degrees).round(2)
+end
+
+def melting_point_of_substance(substance, output_unit)
+  FORMULAS['C' + output_unit].call(TEMPERATURES[substance][0])
+end
+
+def boiling_point_of_substance(substance, output_unit)
+  FORMULAS['C' + output_unit].call(TEMPERATURES[substance][1])
+end

Сложи един нов ред.
Тези
return-и са излишни.Сложи един нов ред.