Class: Git::Lint::Validators::Email
- Inherits:
-
Object
- Object
- Git::Lint::Validators::Email
- Defined in:
- lib/git/lint/validators/email.rb
Instance Method Summary collapse
-
#initialize(text, pattern: URI::MailTo::EMAIL_REGEXP) ⇒ Email
constructor
A new instance of Email.
- #valid? ⇒ Boolean
Constructor Details
#initialize(text, pattern: URI::MailTo::EMAIL_REGEXP) ⇒ Email
Returns a new instance of Email.
9 10 11 12 |
# File 'lib/git/lint/validators/email.rb', line 9 def initialize text, pattern: URI::MailTo::EMAIL_REGEXP @text = text @pattern = pattern end |
Instance Method Details
#valid? ⇒ Boolean
14 15 16 |
# File 'lib/git/lint/validators/email.rb', line 14 def valid? String(text).match? pattern end |