Class: Gitlab::Ci::Badge::Custom::CustomBadge

Inherits:
Base
  • Object
show all
Defined in:
lib/gitlab/ci/badge/custom/custom_badge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#status

Constructor Details

#initialize(project, opts: {}) ⇒ CustomBadge

Returns a new instance of CustomBadge.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/gitlab/ci/badge/custom/custom_badge.rb', line 10

def initialize(project, opts: {})
  @project = project
  @customization = {
    key_width: opts[:key_width] ? opts[:key_width].to_i : nil,
    key_text: opts[:key_text],
    key_color: opts[:key_color],
    value_color: opts[:value_color],
    value_text: opts[:value_text],
    value_width: opts[:value_width] ? opts[:value_width].to_i : nil
  }
end

Instance Attribute Details

#customizationObject (readonly)

Returns the value of attribute customization.



8
9
10
# File 'lib/gitlab/ci/badge/custom/custom_badge.rb', line 8

def customization
  @customization
end

#projectObject (readonly)

Returns the value of attribute project.



8
9
10
# File 'lib/gitlab/ci/badge/custom/custom_badge.rb', line 8

def project
  @project
end

Instance Method Details

#entityObject



22
23
24
# File 'lib/gitlab/ci/badge/custom/custom_badge.rb', line 22

def entity
  'custom'
end

#metadataObject



26
27
28
# File 'lib/gitlab/ci/badge/custom/custom_badge.rb', line 26

def 
  @metadata ||= Custom::Metadata.new(self)
end

#templateObject



30
31
32
# File 'lib/gitlab/ci/badge/custom/custom_badge.rb', line 30

def template
  @template ||= Custom::Template.new(self)
end