Flip Flop Operator in Ruby