From: Patrick Ritchie Date: 2006-02-18T12:32:26+09:00 Subject: define_method fun Hi All, I just setup the following in one of my classes, I'll let the code speak for itself: ["<", "<=", ">", ">=", "==", "<=>"].each do |op| define_method(op) { |comparison| eval "#{self.order} #{op} #{comparison.order}" } end Ruby continues to impress me with it's ability to do so much in so few amazing readable lines of code. Are their any good reasons not to declare my op methods this way? Is their an even more efficient way to achieve the same effect? Cheers! Patrick