Class: OodCore::Job::AccountInfo
- Inherits:
-
Object
- Object
- OodCore::Job::AccountInfo
- Includes:
- DataFormatter
- Defined in:
- lib/ood_core/job/account_info.rb
Instance Attribute Summary collapse
-
#cluster ⇒ Object
readonly
The cluster this account is associated with.
-
#name ⇒ Object
(also: #to_s)
readonly
The name of the account.
-
#qos ⇒ Object
readonly
The QoS values this account can use.
-
#queue ⇒ Object
readonly
The queue this account can use.
Instance Method Summary collapse
-
#initialize(**opts) ⇒ AccountInfo
constructor
A new instance of AccountInfo.
- #to_h ⇒ Object
Methods included from DataFormatter
Constructor Details
#initialize(**opts) ⇒ AccountInfo
Returns a new instance of AccountInfo.
22 23 24 25 26 27 28 |
# File 'lib/ood_core/job/account_info.rb', line 22 def initialize(**opts) orig_name = opts.fetch(:name, 'unknown') @name = upcase_accounts? ? orig_name.upcase : orig_name @qos = opts.fetch(:qos, []) @cluster = opts.fetch(:cluster, nil) @queue = opts.fetch(:queue, nil) end |
Instance Attribute Details
#cluster ⇒ Object (readonly)
The cluster this account is associated with.
16 17 18 |
# File 'lib/ood_core/job/account_info.rb', line 16 def cluster @cluster end |
#name ⇒ Object (readonly) Also known as: to_s
The name of the account.
9 10 11 |
# File 'lib/ood_core/job/account_info.rb', line 9 def name @name end |
#qos ⇒ Object (readonly)
The QoS values this account can use.
13 14 15 |
# File 'lib/ood_core/job/account_info.rb', line 13 def qos @qos end |
#queue ⇒ Object (readonly)
The queue this account can use. nil means there is no queue info for this account.
20 21 22 |
# File 'lib/ood_core/job/account_info.rb', line 20 def queue @queue end |
Instance Method Details
#to_h ⇒ Object
30 31 32 33 34 35 |
# File 'lib/ood_core/job/account_info.rb', line 30 def to_h instance_variables.map do |var| name = var.to_s.gsub('@', '').to_sym [name, send(name)] end.to_h end |