Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/fat_fingers.rb

Instance Method Summary collapse

Instance Method Details

#clean_up_typoed_emailObject

Internal: Check a given string for misspelled TLDs and misspelled domains from popular e-mail providers.

Examples

"[email protected]".clean_up_typoed_email
# => "[email protected]"

"[email protected]".clean_up_typoed_email
# => "[email protected]"

Returns the cleaned String.


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fat_fingers.rb', line 14

def clean_up_typoed_email
  downcase.
  remove_mailto.
  remove_invalid_characters.
  fix_transposed_periods.
  remove_period_around_at_sign.
  handle_different_country_tlds.
  fix_coms_with_appended_letters.
  clean_up_funky_coms.
  clean_up_funky_nets.
  clean_up_funky_orgs.
  clean_up_gmail.
  clean_up_googlemail.
  clean_up_hotmail.
  clean_up_aol.
  clean_up_yahoo.
  clean_up_other_providers.
  clean_up_known_coms.
  add_a_period_if_they_forgot_it
end