Module: ActiveJob::Performs::Waiting

Defined in:
lib/active_job/performs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#waitObject

Returns the value of attribute wait.



8
9
10
# File 'lib/active_job/performs.rb', line 8

def wait
  @wait
end

#wait_untilObject

Returns the value of attribute wait_until.



8
9
10
# File 'lib/active_job/performs.rb', line 8

def wait_until
  @wait_until
end

Instance Method Details

#scoped_by_wait(record) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/active_job/performs.rb', line 18

def scoped_by_wait(record)
  if waits = { wait: wait&.call(record), wait_until: wait_until&.call(record) }.compact and waits.any?
    set(waits)
  else
    self
  end
end