Class: OodCore::Job::ArrayIds
- Inherits:
-
Object
- Object
- OodCore::Job::ArrayIds
- Defined in:
- lib/ood_core/job/array_ids.rb
Overview
Builds a sorted array of job ids given a job array spec string
Job array spec strings:
1 Single id
1-10 Range
1-10:2 Range with step
1-10,13 Compound (range with single id)
Note that Ranges are expected to be inclusive
Instance Attribute Summary collapse
-
#spec_string ⇒ Object
readonly
Returns the value of attribute spec_string.
Instance Method Summary collapse
- #ids ⇒ Object
-
#initialize(spec_string) ⇒ ArrayIds
constructor
A new instance of ArrayIds.
Constructor Details
#initialize(spec_string) ⇒ ArrayIds
Returns a new instance of ArrayIds.
15 16 17 |
# File 'lib/ood_core/job/array_ids.rb', line 15 def initialize(spec_string) @spec_string = spec_string end |
Instance Attribute Details
#spec_string ⇒ Object (readonly)
Returns the value of attribute spec_string.
13 14 15 |
# File 'lib/ood_core/job/array_ids.rb', line 13 def spec_string @spec_string end |
Instance Method Details
#ids ⇒ Object
19 20 21 |
# File 'lib/ood_core/job/array_ids.rb', line 19 def ids @ids ||= parse_spec_string(spec_string) end |