Module: Mindee::Parsing::Common::ExecutionPriority

Defined in:
lib/mindee/parsing/common/execution_priority.rb

Overview

Execution policy priority values.

Constant Summary collapse

LOW =

Low priority execution.

Returns:

  • (Symbol)

    :low

:low
MEDIUM =

Medium priority execution.

Returns:

  • (Symbol)

    :low

:medium
HIGH =

High priority execution.

Returns:

  • (Symbol)

    :low

:high

Class Method Summary collapse

Class Method Details

.to_priority(priority_str) ⇒ Symbol?

Sets the priority to one of its possibly values, defaults to nil otherwise.

Parameters:

  • priority_str (String, nil)

Returns:

  • (Symbol, nil)


21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/mindee/parsing/common/execution_priority.rb', line 21

def self.to_priority(priority_str)
  return nil if priority_str.nil?

  case priority_str.downcase
  when 'low'
    :low
  when 'high'
    :high
  else
    :medium
  end
end