Class: Gitlab::Badge::Pipeline::Metadata

Inherits:
Metadata
  • Object
show all
Defined in:
lib/gitlab/badge/pipeline/metadata.rb

Overview

Class that describes pipeline badge metadata

Instance Method Summary collapse

Methods inherited from Metadata

#to_asciidoc, #to_html, #to_markdown

Methods included from Routing

add_helpers, includes_helpers, redirect_legacy_paths, url_helpers

Constructor Details

#initialize(badge) ⇒ Metadata

Returns a new instance of Metadata.


10
11
12
13
# File 'lib/gitlab/badge/pipeline/metadata.rb', line 10

def initialize(badge)
  @project = badge.project
  @ref = badge.ref
end

Instance Method Details

#image_urlObject


19
20
21
# File 'lib/gitlab/badge/pipeline/metadata.rb', line 19

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

23
24
25
# File 'lib/gitlab/badge/pipeline/metadata.rb', line 23

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

#titleObject


15
16
17
# File 'lib/gitlab/badge/pipeline/metadata.rb', line 15

def title
  'pipeline status'
end