Class: Flagdoc::Priority

Inherits:
Object
  • Object
show all
Defined in:
lib/flagdoc/priority.rb

Overview

Define priorities levels

Since:

  • 0.1.0

Constant Summary collapse

LEVELS =

Since:

  • 0.1.0

{
  'LOW'     => '29',
  'NORMAL'  => '166',
  'HIGH'    => '196'
}.freeze

Class Method Summary collapse

Class Method Details

.available?(priority) ⇒ Boolean

Returns true if the priority is available.

Returns:

  • (Boolean)

    true if the priority is available

Since:

  • 0.1.0



27
28
29
# File 'lib/flagdoc/priority.rb', line 27

def available?(priority)
  LEVELS.key?(priority)
end

.color_code(priority) ⇒ String

Returns with bash color code.

Returns:

  • (String)

    with bash color code

Since:

  • 0.1.0



34
35
36
# File 'lib/flagdoc/priority.rb', line 34

def color_code(priority)
  '48;5;' + LEVELS[priority]
end