On Jun 7, 2007, at 12:42 PM, jdl wrote:
And then I want to check difference to see if it is positive or
if difference < 0
You should seriously consider reading a Ruby (not Rails) tutorial.
Many things should become much more clear to you as a result.
I’ll second jdl, but also point out the comparison method <=> which
returns -1, 0, or 1 depending on whether the left-hand-side is less-
than, equal-to, or greater-than the right-hand-side.
There’s also .nonzero? which is false (nil, actually) when the
receiver is 0, or the value of the receiver otherwise.
irb> 5 <=> 3
irb> 5 <=> 9
irb> 5 <=> 5
Rob B. http://agileconsultingllc.com