class EmailInquire::Validator::CommonlyMistakenTld

Constants

MISTAKES

Public Instance Methods

validate() click to toggle source
# File lib/email_inquire/validator/commonly_mistaken_tld.rb, line 16
def validate
  mistake, reference =
    MISTAKES.find do |mistake, reference|
      next if !mistake.end_with?(reference) && domain.end_with?(reference)

      domain.end_with?(mistake)
    end

  response.hint!(domain: domain.sub(/#{mistake}\z/, reference)) if reference
end