Module: Gitlab::Email::Handler

Defined in:
lib/gitlab/email/handler.rb,
lib/gitlab/email/handler/base_handler.rb,
lib/gitlab/email/handler/reply_processing.rb,
lib/gitlab/email/handler/create_note_handler.rb,
lib/gitlab/email/handler/unsubscribe_handler.rb,
lib/gitlab/email/handler/create_issue_handler.rb,
lib/gitlab/email/handler/service_desk_handler.rb,
lib/gitlab/email/handler/create_merge_request_handler.rb

Defined Under Namespace

Modules: ReplyProcessing Classes: BaseHandler, CreateIssueHandler, CreateMergeRequestHandler, CreateNoteHandler, ServiceDeskHandler, UnsubscribeHandler

Class Method Summary collapse

Class Method Details

.for(mail, mail_key) ⇒ Object


20
21
22
23
24
25
# File 'lib/gitlab/email/handler.rb', line 20

def self.for(mail, mail_key)
  handlers.find do |klass|
    handler = klass.new(mail, mail_key)
    break handler if handler.can_handle?
  end
end

.handlersObject


6
7
8
# File 'lib/gitlab/email/handler.rb', line 6

def self.handlers
  @handlers ||= load_handlers
end

.load_handlersObject


10
11
12
13
14
15
16
17
18
# File 'lib/gitlab/email/handler.rb', line 10

def self.load_handlers
  [
    CreateNoteHandler,
    CreateIssueHandler,
    UnsubscribeHandler,
    CreateMergeRequestHandler,
    ServiceDeskHandler
  ]
end