Method: Doing::ArrayCleanup#remove_bad

Defined in:
lib/doing/array/cleanup.rb

#remove_badArray

Like Array#compact -- removes nil items, but also removes empty strings, zero or negative numbers and FalseClass items

Returns:

  • (Array)

    Array without "bad" elements



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