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
-
#_context ⇒ Context?
: () -> Context?.
-
#_context=(context) ⇒ void
: (Context) -> void.
- #arguments ⇒ Array[untyped]
- #class ⇒ ClassMethods
-
#deserialize(job_data) ⇒ void
: (Hash[String, untyped]) -> void.
- #job_id ⇒ String
-
#output ⇒ Output
: () -> Output.
-
#perform(arguments) ⇒ void
: (Hash[untyped, untyped]) -> void.
- #queue_name ⇒ String
-
#serialize ⇒ Hash[String, untyped]
: () -> Hash[String, untyped].
- #set ⇒ self
- #step {|arg0| ... } ⇒ Object
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_classes ⇒ Set[singleton(DSL)]
13 |
# File 'sig/generated/job_workflow/dsl.rbs', line 13
def self._included_classes: () -> Set[singleton(DSL)]
|
Instance Method Details
#_context ⇒ Context?
: () -> Context?
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
53 54 55 |
# File 'lib/job_workflow/dsl.rb', line 53 def _context=(context) @_context = context end |
#arguments ⇒ Array[untyped]
21 |
# File 'sig/generated/job_workflow/dsl.rbs', line 21
def arguments: () -> Array[untyped]
|
#class ⇒ ClassMethods
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
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_id ⇒ String
17 |
# File 'sig/generated/job_workflow/dsl.rbs', line 17
def job_id: () -> String
|
#output ⇒ Output
: () -> Output
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
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_name ⇒ String
19 |
# File 'sig/generated/job_workflow/dsl.rbs', line 19
def queue_name: () -> String
|
#serialize ⇒ Hash[String, untyped]
: () -> 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 |
#set ⇒ 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
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
|