Class: Clienteer::Sanitizer::NilFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/clienteer/sanitizers/nil_finder.rb

Instance Method Summary collapse

Instance Method Details

#contains_nils?(attrs) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/clienteer/sanitizers/nil_finder.rb', line 18

def contains_nils?(attrs)
  attrs.any? {|a| a.nil? }
end

#process(row) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/clienteer/sanitizers/nil_finder.rb', line 6

def process(row)
  raw = row[:raw]
  attrs = [row, raw, raw.first_name, raw.last_name, raw.email]
  if contains_nils? attrs
    row[:reason] = "contains nils"
    $skipped_people << row
    return nil
  else
    return row
  end
end