Sha256: f9a7549be165bf47da6163b596eddd14d814d7927f8d4206af1ac32423df7588

Contents?: true

Size: 358 Bytes

Versions: 8

Compression:

Stored size: 358 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(configuration.email_pattern.match?(result.email))
        add_error(Truemail::Validate::Regex::ERROR)
        false
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
truemail-1.3.0 lib/truemail/validate/regex.rb
truemail-1.2.1 lib/truemail/validate/regex.rb
truemail-1.2.0 lib/truemail/validate/regex.rb
truemail-1.1.0 lib/truemail/validate/regex.rb
truemail-1.0.1 lib/truemail/validate/regex.rb
truemail-1.0.0 lib/truemail/validate/regex.rb
truemail-0.2.0 lib/truemail/validate/regex.rb
truemail-0.1.10 lib/truemail/validate/regex.rb