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.
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.
18 19 20 21 22 23 |
# File 'lib/ood_core/job/account_info.rb', line 18 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) 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 |
Instance Method Details
#to_h ⇒ Object
25 26 27 28 29 30 |
# File 'lib/ood_core/job/account_info.rb', line 25 def to_h instance_variables.map do |var| name = var.to_s.gsub('@', '').to_sym [name, send(name)] end.to_h end |