Class: OodCore::Job::ArrayIds

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_stringObject (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

#idsObject



19
20
21
# File 'lib/ood_core/job/array_ids.rb', line 19

def ids
  @ids ||= parse_spec_string(spec_string)
end