Class: Gitlab::Badge::Coverage::Metadata

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

Overview

Class that describes coverage 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
14
# File 'lib/gitlab/badge/coverage/metadata.rb', line 10

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

Instance Method Details

#image_urlObject


20
21
22
# File 'lib/gitlab/badge/coverage/metadata.rb', line 20

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

24
25
26
# File 'lib/gitlab/badge/coverage/metadata.rb', line 24

def link_url
  project_commits_url(@project, @ref)
end

#titleObject


16
17
18
# File 'lib/gitlab/badge/coverage/metadata.rb', line 16

def title
  'coverage report'
end