Sha256: 8a321259a821f45c1ab85898834bfc89a770cec466a0de57cbd6f5704af6b930
Contents?: true
Size: 592 Bytes
Versions: 12
Compression:
Stored size: 592 Bytes
Contents
module Clienteer module Sanitizer class Name def process(row) names = [row[:raw].first_name, row[:raw].last_name].compact if names.length == 1 && names[0].include?(" ") names = names[0].split(" ") row[:raw].first_name, row[:raw].last_name = *names end return row if names.all? {|n| proper? n } return remove(row) end def proper?(name) !name.match /\d/ end def remove(row) row[:reason] = "names not valid" $skipped_people << row nil end end end end
Version data entries
12 entries across 12 versions & 1 rubygems