Class: BranchTasks::Sequence
- Inherits:
-
Task
- Object
- Task
- BranchTasks::Sequence
- Defined in:
- lib/behave_fun/branch_tasks/sequence.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#current_child_idx ⇒ Object
Returns the value of attribute current_child_idx.
Instance Method Summary collapse
- #child_fail ⇒ Object
- #child_running ⇒ Object
- #child_success ⇒ Object
- #execute ⇒ Object
- #serializable_status_fields ⇒ Object
- #start ⇒ Object
Instance Attribute Details
#current_child_idx ⇒ Object
Returns the value of attribute current_child_idx.
3 4 5 |
# File 'lib/behave_fun/branch_tasks/sequence.rb', line 3 def current_child_idx @current_child_idx end |
Instance Method Details
#child_fail ⇒ Object
27 28 29 |
# File 'lib/behave_fun/branch_tasks/sequence.rb', line 27 def child_fail fail end |
#child_running ⇒ Object
14 15 16 |
# File 'lib/behave_fun/branch_tasks/sequence.rb', line 14 def child_running running end |
#child_success ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/behave_fun/branch_tasks/sequence.rb', line 18 def child_success @current_child_idx += 1 if @current_child_idx >= children.size success else run end end |
#execute ⇒ Object
5 6 7 |
# File 'lib/behave_fun/branch_tasks/sequence.rb', line 5 def execute @children[@current_child_idx].run end |
#serializable_status_fields ⇒ Object
31 32 33 |
# File 'lib/behave_fun/branch_tasks/sequence.rb', line 31 def serializable_status_fields [:current_child_idx] end |
#start ⇒ Object
9 10 11 12 |
# File 'lib/behave_fun/branch_tasks/sequence.rb', line 9 def start super @current_child_idx = 0 end |