Class: Git::Lint::Validators::Email

Inherits:
Object
  • Object
show all
Defined in:
lib/git/lint/validators/email.rb

Overview

Validates the format of email addresses.

Instance Method Summary collapse

Constructor Details

#initialize(pattern: URI::MailTo::EMAIL_REGEXP) ⇒ Email

Returns a new instance of Email.



10
11
12
# File 'lib/git/lint/validators/email.rb', line 10

def initialize pattern: URI::MailTo::EMAIL_REGEXP
  @pattern = pattern
end

Instance Method Details

#call(content) ⇒ Object



14
# File 'lib/git/lint/validators/email.rb', line 14

def call(content) = String(content).match? pattern