Method: Doing::ArrayCleanup#remove_empty
- Defined in:
- lib/doing/array/cleanup.rb
#remove_empty ⇒ Array
Like Array#compact -- removes nil items, but also removes empty elements
23 24 25 |
# File 'lib/doing/array/cleanup.rb', line 23 def remove_empty compact.map { |x| x.is_a?(String) ? x.strip : x }.reject { |x| x.is_a?(String) ? x.empty? : false } end |