Is there a better way to do this? That switch_statusswitch_status
method seems like it could be made a lot more compact. Any advice would be most appreciated :)
class Taxi
def initialize
@status = :available
end
def switch_status
if @status == :available
@status = :busy
else
@status = :available
end
end
end
t = Taxi.new
t.switch_status