Sha256: a93af179e366cbc8e2c1566a630f386c3261b7eb4707cf6a47ee3a189dd4cd39

Contents?: true

Size: 365 Bytes

Versions: 6

Compression:

Stored size: 365 Bytes

Contents

module CopyleaksApi
  module Validators
    class EmailValidator
      class << self
        # raises error if given email is invalid
        def validate!(email)
          return if email =~ /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
          raise BadEmailError.new(email), "Email #{email} is invalid"
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
plagiarism-checker-2.1.2 lib/copyleaks_api/validators/email_validator.rb
plagiarism-checker-2.1.1 lib/copyleaks_api/validators/email_validator.rb
plagiarism-checker-2.1.0 lib/copyleaks_api/validators/email_validator.rb
plagiarism-checker-2.0.0 lib/copyleaks_api/validators/email_validator.rb
plagiarism-checker-1.0.0 lib/copyleaks_api/validators/email_validator.rb
mkisilenko-test-0.1.0 lib/copyleaks_api/validators/email_validator.rb