DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Use Array#all? To Identify An Array Containing Nil
Determine if all items in an array are workable object using Array#all? e.g.
['cat', nil, 'bat', 'mat'].all? #=> false ['cat', 'hat', 'bat', 'mat'].all? #=> true
Resources: - <a href="http://ruby-doc.org/core/classes/Enumerable.html#M003131">Module: Enumerable</a> [ruby-doc.org]






Comments
Daniel Berger replied on Thu, 2007/07/12 - 5:21pm