From: Robert Feldt Date: 2001-11-29T22:07:29+09:00 Subject: [ruby-talk:26887] Re: Can this be factored? On Thu, 29 Nov 2001, Mark Hahn wrote: > The two if statements below are identical except the words left and right > (and < & >) are reversed. I don't think this can be factored but I thought > I'd throw this out to see if anyone can think of a way. > I haven't gone through it all but what about the "pattern" a < b => a.send(:<, b) so that you can specify the method (:< or :>) in a parameter. Likewise for @left or @right and off you go?! /Robert