Module: JobWorkflow::DSL

Extended by:
ActiveSupport::Concern, ClassMethods
Includes:
ActiveJob::Continuable
Defined in:
lib/job_workflow/dsl.rb,
sig/generated/job_workflow/dsl.rbs

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ClassMethods

_workflow, after, argument, around, before, class_attribute, dry_run, enqueue, from_context, limits_concurrency, name, new, on_error, queue_as, schedule, task, workflow_concurrency

Class Method Details

._included_classesSet[singleton(DSL)]

Returns:

  • (Set[singleton(DSL)])


13
# File 'sig/generated/job_workflow/dsl.rbs', line 13

def self._included_classes: () -> Set[singleton(DSL)]

Instance Method Details

#_contextContext?

: () -> Context?

Returns:



58
59
60
# File 'lib/job_workflow/dsl.rb', line 58

def _context
  @_context
end

#_context=(context) ⇒ void

This method returns an undefined value.

: (Context) -> void

Parameters:



53
54
55
# File 'lib/job_workflow/dsl.rb', line 53

def _context=(context)
  @_context = context
end

#argumentsArray[untyped]

Returns:

  • (Array[untyped])


21
# File 'sig/generated/job_workflow/dsl.rbs', line 21

def arguments: () -> Array[untyped]

#classClassMethods

Returns:



15
# File 'sig/generated/job_workflow/dsl.rbs', line 15

def class: () -> ClassMethods

#deserialize(job_data) ⇒ void

This method returns an undefined value.

: (Hash[String, untyped]) -> void

Parameters:

  • (Hash[String, untyped])


68
69
70
71
72
73
74
75
76
# File 'lib/job_workflow/dsl.rb', line 68

def deserialize(job_data)
  super

  job_data["job_workflow_context"]&.then do |context_data|
    self._context = Context.deserialize(
      context_data.merge("job" => self, "workflow" => self.class._workflow)
    )
  end
end

#job_idString

Returns:

  • (String)


17
# File 'sig/generated/job_workflow/dsl.rbs', line 17

def job_id: () -> String

#outputOutput

: () -> Output

Returns:



45
46
47
48
49
50
# File 'lib/job_workflow/dsl.rb', line 45

def output
  context = _context
  raise "context is not set." if context.nil?

  context.output
end

#perform(arguments) ⇒ void

This method returns an undefined value.

: (Hash[untyped, untyped]) -> void

Parameters:

  • (Hash[untyped, untyped])


38
39
40
41
42
# File 'lib/job_workflow/dsl.rb', line 38

def perform(arguments)
  self._context ||= Context.from_hash({ job: self, workflow: self.class._workflow })
  context = _context #: Context
  Runner.new(context: context._update_arguments(arguments)).run
end

#queue_nameString

Returns:

  • (String)


19
# File 'sig/generated/job_workflow/dsl.rbs', line 19

def queue_name: () -> String

#serializeHash[String, untyped]

: () -> Hash[String, untyped]

Returns:

  • (Hash[String, untyped])


63
64
65
# File 'lib/job_workflow/dsl.rb', line 63

def serialize
  super.merge({ "job_workflow_context" => _context&.serialize }.compact)
end

#setself

Parameters:

  • (Hash[Symbol, untyped])

Returns:

  • (self)


23
# File 'sig/generated/job_workflow/dsl.rbs', line 23

def set: (Hash[Symbol, untyped]) -> self

#step(arg0, start:, isolated:) ⇒ void #step(arg0, start:, isolated:) ⇒ void

Overloads:

  • #step(arg0, start:, isolated:) ⇒ void

    This method returns an undefined value.

    Parameters:

    • arg0 (Symbol)
    • start: (ActiveJob::Continuation::_Succ)
    • isolated: (Boolean)
  • #step(arg0, start:, isolated:) ⇒ void

    This method returns an undefined value.

    Parameters:

    • arg0 (Symbol)
    • start: (ActiveJob::Continuation::_Succ)
    • isolated: (Boolean)

Yields:

Yield Parameters:

  • arg0 (ActiveJob::Continuation::Step)

Yield Returns:

  • (void)


25
26
# File 'sig/generated/job_workflow/dsl.rbs', line 25

def step: (Symbol, ?start: ActiveJob::Continuation::_Succ, ?isolated: bool) -> void
| (Symbol, ?start: ActiveJob::Continuation::_Succ, ?isolated: bool) { (ActiveJob::Continuation::Step) -> void } -> void