From: Gavin Sinclair Date: 2012-02-02T20:55:40+09:00 Subject: Re: Multiple assignment in conditional On Thu, Feb 2, 2012 at 7:15 AM, Joel VanderWerf wrote: > You can trick ruby: > > def foo; nil; end > > if (_ = (a, b = foo)) [...] Done and done! def week_and_day(date) if not self.include? date nil elsif _ = (week, day = @t1.week_and_day(date)) [week, day] elsif _= (week, day = @t2.week_and_day(date)) [week + @t1.number_of_weeks, day] end end I guess I need to document a Ruby 1.9.3+ requirement :)