1.9.3-p0 :009 > a = [1]
=> [1]
1.9.3-p0 :010 > p 'not empty' if a.any?
=> "not empty"
1.9.3-p0 :006 > a = []
=> []
1.9.3-p0 :007 > p 'empty' if a.empty?
=> "empty"
1.9.3-p0 :012 > [1,nil].all?
=> false
1.9.3-p0 :013 > [1,2].all?
=> true
Conteúdo para você se capacitar em programação
1.9.3-p0 :009 > a = [1]
=> [1]
1.9.3-p0 :010 > p 'not empty' if a.any?
=> "not empty"
1.9.3-p0 :006 > a = []
=> []
1.9.3-p0 :007 > p 'empty' if a.empty?
=> "empty"
1.9.3-p0 :012 > [1,nil].all?
=> false
1.9.3-p0 :013 > [1,2].all?
=> true