gitlab-org--gitlab-foss/lib/gitlab/badge/pipeline/metadata.rb
gfyoung e166e5747c Enable some frozen string in lib/gitlab
Enable frozen string for the following files:

* lib/gitlab/auth/**/*.rb
* lib/gitlab/badge/**/*.rb
* lib/gitlab/bare_repository_import/**/*.rb
* lib/gitlab/bitbucket_import/**/*.rb
* lib/gitlab/bitbucket_server_import/**/*.rb
* lib/gitlab/cache/**/*.rb
* lib/gitlab/checks/**/*.rb

Partially addresses #47424.
2018-10-13 02:31:31 -07:00

29 lines
567 B
Ruby

# frozen_string_literal: true
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