Method: Doing::ArrayCleanup#remove_bad
- Defined in:
- lib/doing/array/cleanup.rb
#remove_bad ⇒ Array
Like Array#compact -- removes nil items, but also removes empty strings, zero or negative numbers and FalseClass items
9 10 11 |
# File 'lib/doing/array/cleanup.rb', line 9 def remove_bad compact.map { |x| x.is_a?(String) ? x.strip : x }.select(&:good?) end |