Class: Gitlab::Email::Handler::CreateNoteHandler
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- Gitlab::Email::Handler::CreateNoteHandler
- Includes:
- ReplyProcessing
- Defined in:
- lib/gitlab/email/handler/create_note_handler.rb
Instance Attribute Summary
Attributes inherited from BaseHandler
Instance Method Summary collapse
Methods included from ReplyProcessing
Methods inherited from BaseHandler
Constructor Details
This class inherits a constructor from Gitlab::Email::Handler::BaseHandler
Instance Method Details
#can_handle? ⇒ Boolean
18 19 20 |
# File 'lib/gitlab/email/handler/create_note_handler.rb', line 18 def can_handle? mail_key =~ /\A\w+\z/ end |
#execute ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/gitlab/email/handler/create_note_handler.rb', line 22 def execute raise SentNotificationNotFoundError unless sent_notification (:create_note) validate_from_address! raise NoteableNotFoundError unless noteable raise EmptyEmailError if .blank? verify_record!( record: create_note, invalid_exception: InvalidNoteError, record_name: 'comment') end |
#metrics_event ⇒ Object
38 39 40 |
# File 'lib/gitlab/email/handler/create_note_handler.rb', line 38 def metrics_event :receive_email_create_note end |