class Thermostat
Attributes
difference[R]
Public Class Methods
new(difference)
click to toggle source
Constructor that it passes by parameter the difference between the value that we want and the value that the thermostat obtain with the sensor
# File lib/thermostat.rb, line 6 def initialize (difference) @difference=difference end
Public Instance Methods
print()
click to toggle source
Method to print options that can happen on the thermostat
# File lib/thermostat.rb, line 10 def print puts "Heating: ON \nCooling: OFF" if (difference > 0) puts "Heating: OFF \nCooling: ON" if(difference < 0) puts "Heating: OFF \nCooling: OFF" if(difference == 0) puts "Difference: "+difference.to_s end