From: ChrisH Date: 2007-02-15T04:50:05+09:00 Subject: Re: Drying a ternary condition On Feb 14, 1:18 pm, Marcello Barnaba wrote: > How would you write the following statement: > > klass.send((ARGV[0] || :up).to_sym == :up ? :up : :down) > > ? > > Thanks :) > -- > pub 1024D/8D2787EF 723C 7CA3 3C19 2ACE 6E20 9CC1 9956 EB3C 8D27 87EF def upOrdown(a) a ||= 'up' if a == 'up' :up else :down end end ... klass.send(upOrdown(ARGV[0])) Cheers Chris