Method: OodCore::Job::QueueInfo#initialize

Defined in:
lib/ood_core/job/queue_info.rb

#initialize(**opts) ⇒ QueueInfo

Returns a new instance of QueueInfo.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/ood_core/job/queue_info.rb', line 27

def initialize(**opts)
  @name = opts.fetch(:name, 'unknown')
  @allow_qos = opts.fetch(:allow_qos, [])
  @deny_qos = opts.fetch(:deny_qos, [])
  @tres = opts.fetch(:tres, {})

  allow_accounts = opts.fetch(:allow_accounts, nil)
  @allow_accounts = if allow_accounts.nil?
                      nil
                    else
                      allow_accounts.compact.map { |acct| upcase_accounts? ? acct.to_s.upcase : acct }
                    end

  @deny_accounts = opts.fetch(:deny_accounts, []).compact.map do |acct|
    upcase_accounts? ? acct.to_s.upcase : acct
  end
end