class Calculator

Attributes

temp[RW]

Public Instance Methods

calc_setting(args) click to toggle source

test = JSONThermostat.new Convert the wanted value to Celsius.

# File lib/calculator.rb, line 7
def calc_setting(args)
  temp = if args[:unit] == 'fahrenheit'
           (args[:value] - 32.0) / 1.8
         elsif args[:unit] == 'kelvin'
           args[:value] - 273.2
         else
           args[:value]
         end
end