instance method step

Ruby on Rails 8.1.2

Since v8.1.2

Signature

step(step_name, start: nil, isolated: false, &block)

Start a new continuation step

Parameters

step_name req
start key = nil
isolated key = false
block block
Source
# File activejob/lib/active_job/continuable.rb, line 36
    def step(step_name, start: nil, isolated: false, &block)
      unless block_given?
        step_method = method(step_name)

        raise ArgumentError, "Step method '#{step_name}' must accept 0 or 1 arguments" if step_method.arity > 1

        if step_method.parameters.any? { |type, name| type == :key || type == :keyreq }
          raise ArgumentError, "Step method '#{step_name}' must not accept keyword arguments"
        end

        block = step_method.arity == 0 ? -> (_) { step_method.call } : step_method
      end
      checkpoint! if continuation.advanced?
      continuation.step(step_name, start: start, isolated: isolated, &block)
    end

Defined in activejob/lib/active_job/continuable.rb line 36 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveJob::Continuable

Type at least 2 characters to search.

↑↓ navigate · open · esc close