Method: Enumerable#compact
- Defined in:
- lib/jinx/helpers/enumerable.rb
#compact ⇒ Enumerable
Returns an iterator over the non-nil items in this Enumerable.
148 149 150 |
# File 'lib/jinx/helpers/enumerable.rb', line 148 def compact filter { |item| not item.nil? } end |