Ruby's Enumerable module has #any?, #none?, and #all? We just hit a scenario where we really wanted to know if it had some but not all...
module Enumerable def some? self.any? && !self.all? end end
irb> [1,2,3].some? => false irb> [1,2,nil].some? => true irb> [nil].some? => false irb> .some? => false