With all? and any? you can check, if all or any elements of an Array or Hash (or any other class that includes the Enumerable module) match a certain criteria. The result is either true or false.
%w{ ant bear cat}.all? {|word| word.length >= 3} #=> true
%w{ ant bear cat}.all? {|word| word.length >= 4} #=> false
[ nil, true, 99 ].all? #=> false
%w{ ant bear cat}.any? {|word| word.length >= 3} #=> true
%w{ ant bear cat}.any? {|word| word.length >= 4} #=> true
[ nil, true, 99 ].any? #=> true
All examples taken from the Ruby rdoc documentation.
You can use HTML tags for formatting. Wrap code in <code> tags and multiple lines of code in <pre><code> tags.