debian-mirror-gitlab/lib/gitlab/email/handler/base_handler.rb

31 lines
582 B
Ruby
Raw Normal View History

2018-11-20 20:47:30 +05:30
# frozen_string_literal: true
2016-09-13 17:45:13 +05:30
module Gitlab
module Email
module Handler
class BaseHandler
attr_reader :mail, :mail_key
2019-02-13 22:33:31 +05:30
HANDLER_ACTION_BASE_REGEX ||= /(?<project_slug>.+)-(?<project_id>\d+)/.freeze
2016-09-13 17:45:13 +05:30
def initialize(mail, mail_key)
@mail = mail
@mail_key = mail_key
end
2019-02-13 22:33:31 +05:30
def can_handle?
2016-09-13 17:45:13 +05:30
raise NotImplementedError
end
2017-08-17 22:00:37 +05:30
def execute
2016-09-13 17:45:13 +05:30
raise NotImplementedError
end
2017-08-17 22:00:37 +05:30
def metrics_params
{ handler: self.class.name }
2016-09-13 17:45:13 +05:30
end
end
end
end
end