Class: Whenever::JobSequence

Inherits:
Array
  • Object
show all
Defined in:
lib/whenever/job_sequence.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}, size = 0, obj = nil) ⇒ JobSequence

Returns a new instance of JobSequence.



5
6
7
8
9
# File 'lib/whenever/job_sequence.rb', line 5

def initialize(options={}, size=0, obj=nil)
  super(size, obj)
  
  @dependent = options.fetch(:dependent, true)
end

Instance Attribute Details

#dependent=(value) ⇒ Object (writeonly)

Sets the attribute dependent

Parameters:

  • value

    the value to set the attribute dependent to.



3
4
5
# File 'lib/whenever/job_sequence.rb', line 3

def dependent=(value)
  @dependent = value
end

Instance Method Details

#to_single_jobObject



11
12
13
14
# File 'lib/whenever/job_sequence.rb', line 11

def to_single_job
  concatenation = @dependent ? " && " : "; "
  Job::Default.new(:task => map(&:output).join(concatenation))
end