core.rb 1.27 KB
Newer Older
1 2 3
module Gitlab
  module Ci
    module Status
4 5
      # Base abstract class fore core status
      #
6
      class Core
7 8
        include Gitlab::Routing.url_helpers

9 10 11
        attr_reader :subject, :user

        def initialize(subject, user)
12
          @subject = subject
13
          @user = user
14 15 16 17 18 19 20 21 22 23
        end

        def icon
          raise NotImplementedError
        end

        def label
          raise NotImplementedError
        end

24 25 26 27 28 29 30 31
        # Deprecation warning: this method is here because we need to maintain
        # backwards compatibility with legacy statuses. We often do something
        # like "ci-status ci-status-#{status}" to set CSS class.
        #
        # `to_s` method should be renamed to `group` at some point, after
        # phasing legacy satuses out.
        #
        def to_s
32
          self.class.name.demodulize.downcase.underscore
33 34
        end

35
        def has_details?
Kamil Trzcinski's avatar
Kamil Trzcinski committed
36
          false
37 38 39 40 41 42
        end

        def details_path
          raise NotImplementedError
        end

43
        def has_action?
Kamil Trzcinski's avatar
Kamil Trzcinski committed
44
          false
45 46 47 48 49 50 51 52 53
        end

        def action_icon
          raise NotImplementedError
        end

        def action_path
          raise NotImplementedError
        end
Kamil Trzcinski's avatar
Kamil Trzcinski committed
54 55 56 57

        def action_method
          raise NotImplementedError
        end
58 59 60 61
      end
    end
  end
end