You are viewing a single comment's thread. Return to all comments →
def convert_temp(temp, **option) if option[:input_scale] == "kelvin" temp = temp - 273.15 elsif option[:input_scale] == "fahrenheit" temp = ((temp - 32) / 1.8) end if option[:output_scale] == "kelvin" temp = temp + 273.15 elsif option[:output_scale] == "fahrenheit" temp = 1.8 * temp +32 end temp end
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby - Methods - Keyword Arguments
You are viewing a single comment's thread. Return to all comments →