Class: JobWorkflow::TaskCallable
- Inherits:
-
Object
- Object
- JobWorkflow::TaskCallable
- Defined in:
- lib/job_workflow/task_callable.rb,
sig/generated/job_workflow/task_callable.rbs
Defined Under Namespace
Classes: AlreadyCalledError, NotCalledError
Instance Attribute Summary collapse
- #block ⇒ Object readonly
- #called ⇒ Boolean
Instance Method Summary collapse
-
#call ⇒ void
: () -> void.
-
#called? ⇒ Boolean
: () -> bool.
-
#initialize { ... } ⇒ TaskCallable
constructor
: () { () -> void } -> void.
Constructor Details
#initialize { ... } ⇒ TaskCallable
: () { () -> void } -> void
20 21 22 23 |
# File 'lib/job_workflow/task_callable.rb', line 20 def initialize(&block) @block = block #: () -> void @called = false #: bool end |
Instance Attribute Details
#block ⇒ Object (readonly)
40 41 42 |
# File 'lib/job_workflow/task_callable.rb', line 40 def block @block end |
#called ⇒ Boolean
41 42 43 |
# File 'lib/job_workflow/task_callable.rb', line 41 def called @called end |
Instance Method Details
#call ⇒ void
This method returns an undefined value.
: () -> void
26 27 28 29 30 31 |
# File 'lib/job_workflow/task_callable.rb', line 26 def call raise AlreadyCalledError if called self.called = true block.call end |
#called? ⇒ Boolean
: () -> bool
34 35 36 |
# File 'lib/job_workflow/task_callable.rb', line 34 def called? called end |