Class: Taskinator::Task::SubProcess
- Inherits:
-
Task
- Object
- Task
- Taskinator::Task::SubProcess
- Defined in:
- lib/taskinator/task.rb
Overview
a task which delegates to another process
Instance Attribute Summary collapse
-
#sub_process ⇒ Object
readonly
Returns the value of attribute sub_process.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #can_complete_task? ⇒ Boolean
-
#initialize(name, process, sub_process, options = {}) ⇒ SubProcess
constructor
A new instance of SubProcess.
- #start ⇒ Object
Constructor Details
#initialize(name, process, sub_process, options = {}) ⇒ SubProcess
Returns a new instance of SubProcess.
156 157 158 159 160 161 162 |
# File 'lib/taskinator/task.rb', line 156 def initialize(name, process, sub_process, ={}) super(name, process, ) raise ArgumentError, 'sub_process' if sub_process.nil? || !sub_process.is_a?(Process) @sub_process = sub_process @sub_process.parent = self end |
Instance Attribute Details
#sub_process ⇒ Object (readonly)
Returns the value of attribute sub_process.
154 155 156 |
# File 'lib/taskinator/task.rb', line 154 def sub_process @sub_process end |
Instance Method Details
#accept(visitor) ⇒ Object
173 174 175 176 |
# File 'lib/taskinator/task.rb', line 173 def accept(visitor) super visitor.visit_process(:sub_process) end |
#can_complete_task? ⇒ Boolean
168 169 170 171 |
# File 'lib/taskinator/task.rb', line 168 def can_complete_task? # NOTE: this works out-of-process, so there isn't any issue sub_process.completed? end |
#start ⇒ Object
164 165 166 |
# File 'lib/taskinator/task.rb', line 164 def start sub_process.start! end |