Commit 3ced5ae6 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Save the list of handlers in a constant

parent 5608e1a1
......@@ -4,8 +4,10 @@ require 'gitlab/email/handler/create_issue_handler'
module Gitlab
module Email
module Handler
HANDLERS = [CreateNoteHandler, CreateIssueHandler]
def self.for(mail, mail_key)
[CreateNoteHandler, CreateIssueHandler].find do |klass|
HANDLERS.find do |klass|
handler = klass.new(mail, mail_key)
break handler if handler.can_handle?
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment