Michal Burak wrote:
> Any way to make this shorter?
> 
> list2 << list1 if list1 && !list1.empty?
> 
> Thanks.

if you know list1 will never be nil, then you can do

list2 << list1 unless list1.empty?


~Jeremy
-- 
Posted via http://www.ruby-forum.com/.