Module: Labels

Defined in:
lib/extensions/utils/labels.rb

Overview

A simple helper method handles the status of the target text. This is used to display whether a GitHub issue or a Jira ticket is open or closed etc.

Class Method Summary collapse

Class Method Details

.getstatus(attrs) ⇒ String

Returns the status and/or label to be displayed.

Parameters:

  • attrs (Array)

    attributes passed by the inline macro

Returns:

  • (String)

    the status and/or label to be displayed



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/extensions/utils/labels.rb', line 9

def self.getstatus(attrs)
  status = attrs['status']
  if status == ('done' || 'closed')
    label = 'success'
  elsif status == 'open'
    label = 'warning'
  else
    status = 'unknown'
    label = 'default'
  end
end