Class: UpstreamHelper

Inherits:
ExtensionHelper show all
Defined in:
lib/jenkins_pipeline_builder/extensions/helpers/triggers/upstream_helper.rb

Instance Attribute Summary collapse

Attributes inherited from ExtensionHelper

#builder, #params

Instance Method Summary collapse

Constructor Details

#initialize(extension, params, builder) ⇒ UpstreamHelper

Returns a new instance of UpstreamHelper.



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/jenkins_pipeline_builder/extensions/helpers/triggers/upstream_helper.rb', line 3

def initialize(extension, params, builder)
  super extension, params, builder

  case params[:status]
  when 'unstable'
    @name = 'UNSTABLE'
    @ordinal = '1'
    @color = 'yellow'
  when 'failed'
    @name = 'FAILURE'
    @ordinal = '2'
    @color = 'RED'
  else
    @name = 'SUCCESS'
    @ordinal = '0'
    @color = 'BLUE'
  end
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



2
3
4
# File 'lib/jenkins_pipeline_builder/extensions/helpers/triggers/upstream_helper.rb', line 2

def color
  @color
end

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/jenkins_pipeline_builder/extensions/helpers/triggers/upstream_helper.rb', line 2

def name
  @name
end

#ordinalObject (readonly)

Returns the value of attribute ordinal.



2
3
4
# File 'lib/jenkins_pipeline_builder/extensions/helpers/triggers/upstream_helper.rb', line 2

def ordinal
  @ordinal
end