Is there a better way to do this? That switch_status
method seems like it could be made a lot more compact.
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