Class: System
- Inherits:
-
Object
- Object
- System
- Defined in:
- lib/system.rb
Instance Method Summary collapse
-
#initialize ⇒ System
constructor
A new instance of System.
- #set(value) ⇒ Object
- #string ⇒ Object
Constructor Details
Instance Method Details
#set(value) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/system.rb', line 8 def set(value) if value > 0 @heating.on @cooling.off elsif value < 0 @heating.off @cooling.on else @heating.off @cooling.off end end |
#string ⇒ Object
23 24 25 |
# File 'lib/system.rb', line 23 def string() "The heating is #{@heating.status}\nThe coolling is #{@cooling.status}" end |