class Apes::Validators::EmailValidator
Validates email.
Public Class Methods
new(options)
click to toggle source
Creates a new validator.
@param options [Hash] The options for the validations. @return [Apes::Validators::EmailValidator] A new validator.
Calls superclass method
# File lib/apes/validators.rb, line 91 def initialize(options) super(options.reverse_merge(default_message: "must be a valid email")) end
Public Instance Methods
check_valid?(value)
click to toggle source
Checks if the value is valid for this validator.
@param value [Object] The value to validate. @return [Boolean] `true` if the value is valid, false otherwise.
# File lib/apes/validators.rb, line 99 def check_valid?(value) value.blank? || UrlsParser.instance.email?(value.ensure_string) end