Sha256: 35f0587ca35428e06320b8e115728edf0032d717d98ffd6ca3aaf0fd077ac5e8

Contents?: true

Size: 367 Bytes

Versions: 9

Compression:

Stored size: 367 Bytes

Contents

# frozen_string_literal: true

module Truemail
  module Validate
    class Regex < Truemail::Validate::Base
      ERROR = 'email does not match the regular expression'

      def run
        return true if success(Truemail.configuration.email_pattern.match?(result.email))
        add_error(Truemail::Validate::Regex::ERROR)
        false
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
truemail-0.1.9 lib/truemail/validate/regex.rb
truemail-0.1.8 lib/truemail/validate/regex.rb
truemail-0.1.7 lib/truemail/validate/regex.rb
truemail-0.1.6 lib/truemail/validate/regex.rb
truemail-0.1.5 lib/truemail/validate/regex.rb
truemail-0.1.4 lib/truemail/validate/regex.rb
truemail-0.1.3 lib/truemail/validate/regex.rb
truemail-0.1.2 lib/truemail/validate/regex.rb
truemail-0.1.1.3 lib/truemail/validate/regex.rb