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