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

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

Overview

Execution policy priority values.

Constant Summary collapse

LOW =
:low
MEDIUM =
:medium
HIGH =
: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)


15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/mindee/parsing/common/execution_priority.rb', line 15

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