metadata.rb 536 Bytes
Newer Older
1 2
module Gitlab
  module Badge
3
    module Pipeline
4
      ##
5
      # Class that describes pipeline badge metadata
6
      #
7
      class Metadata < Badge::Metadata
8 9 10
        def initialize(badge)
          @project = badge.project
          @ref = badge.ref
11 12
        end

13
        def title
14
          'pipeline status'
15 16 17
        end

        def image_url
18
          pipeline_project_badges_url(@project, @ref, format: :svg)
19 20 21
        end

        def link_url
22
          project_commits_url(@project, id: @ref)
23 24 25 26 27
        end
      end
    end
  end
end