Class: Relais
- Inherits:
-
Object
- Object
- Relais
- Defined in:
- lib/relais.rb
Instance Method Summary collapse
Instance Method Details
#get_cooling ⇒ Object
19 20 21 |
# File 'lib/relais.rb', line 19 def get_cooling "The cooling is #{@cooling}" end |
#get_heating ⇒ Object
15 16 17 |
# File 'lib/relais.rb', line 15 def get_heating "The heating is #{@heating}" end |
#set(temp, set, range) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/relais.rb', line 2 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 |