class System

Public Class Methods

new() click to toggle source
# File lib/system.rb, line 3
def initialize()
    @heating = Relais.new
    @cooling = Relais.new
end

Public Instance Methods

set(value) click to toggle source
# 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() click to toggle source
# File lib/system.rb, line 23
def string()
    "The heating is #{@heating.status}\nThe coolling is #{@cooling.status}"
end