summaryrefslogtreecommitdiff
path: root/lib/gitlab/badge/pipeline/metadata.rb
blob: db1e9f8cfb807b17999b3054604f47816d062e95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
module Gitlab
  module Badge
    module Pipeline
      ##
      # Class that describes pipeline badge metadata
      #
      class Metadata < Badge::Metadata
        def initialize(badge)
          @project = badge.project
          @ref = badge.ref
        end

        def title
          'pipeline status'
        end

        def image_url
          pipeline_project_badges_url(@project, @ref, format: :svg)
        end

        def link_url
          project_commits_url(@project, id: @ref)
        end
      end
    end
  end
end