Class: EmailInquire::Validator::CommonlyMistakenDomain
- Defined in:
- lib/email_inquire/validator/commonly_mistaken_domain.rb
Constant Summary collapse
- MISTAKES =
{ /google(?!mail)/ => "gmail.com", /windows.*\.com/ => "live.com", }.freeze
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from EmailInquire::Validator::Base
Instance Method Details
#validate ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/email_inquire/validator/commonly_mistaken_domain.rb', line 14 def validate return response.valid! if MISTAKES.value?(domain) _mistake, reference = MISTAKES.find do |mistake, _reference| mistake =~ domain end response.hint!(domain: reference) if reference end |