lib/email_inquire/inquirer.rb in email_inquire-0.10.0 vs lib/email_inquire/inquirer.rb in email_inquire-0.11.0
- old
+ new
@@ -15,16 +15,10 @@
require "email_inquire/validator/unique_domain_provider"
module EmailInquire
class Inquirer
- def initialize(email)
- @email = email&.downcase
- end
-
- attr_reader :email
-
VALIDATORS = [
# Format first
EmailInquire::Validator::EmailFormat,
# Custom overrides
@@ -43,9 +37,15 @@
EmailInquire::Validator::CommonlyMistakenDomain,
EmailInquire::Validator::CommonlyMistakenTld,
EmailInquire::Validator::CountryCodeTld,
EmailInquire::Validator::UniqueDomainProvider,
].freeze
+
+ def initialize(email)
+ @email = email&.downcase
+ end
+
+ attr_reader :email
def validate
response = Helper.first_value(VALIDATORS) { |validator| validator.validate(email) }
response || Response.new(email: email).valid!