class Relais
Public Instance Methods
get_cooling()
click to toggle source
this method tells you if the cooling is enabled or not
# File lib/relais.rb, line 22 def get_cooling "The cooling is #{@cooling}" end
get_heating()
click to toggle source
this method tells you if the heating is enabled or not
# File lib/relais.rb, line 17 def get_heating "The heating is #{@heating}" end
set(temp, set, range)
click to toggle source
this method will define if the heating and/or the cooling should be enabled
# File lib/relais.rb, line 3 def set(temp, set, range) if temp < (set - range) @heating = true @cooling = false elsif temp > (set + range) @heating = false @cooling = true else @heating = false @cooling = false end end