Topic: Conditional assignment - an easy Q
Hi, I was wondering whether there was a nice simple one line piece of ruby code to do the following. I'm sure i've read something which does this, or something similar; my mind is a little rusty today!
If a value currently equals A then change it to B, if it currently equals B then change it to A, if it equals neither then set it to B.
I'm not really fussed if it's more than one line, just thought ruby might have something that would do it in one, ;-)