Class: BehaveFun::Decorator
- Inherits:
-
Task
- Object
- Task
- BehaveFun::Decorator
show all
- Defined in:
- lib/behave_fun/decorator.rb
Instance Attribute Summary
Attributes inherited from Task
#children, #context, #control, #guard, #params, #status
Instance Method Summary
collapse
Methods inherited from Task
#cancel, #cancelled?, #dup, #ended?, #fail, #failed?, #fresh?, #guard_passed?, #initialize, #reset, #run, #running, #running?, #start, #succeeded?, #success, task_name
#as_json, #dump_status, #name, #restore_status, #serializable_status_fields
Instance Method Details
#add_child(child) ⇒ Object
19
20
21
22
23
24
|
# File 'lib/behave_fun/decorator.rb', line 19
def add_child(child)
if children.size > 0
raise Error, 'A decorator task cannot have more than one child'
end
super
end
|
#child_fail ⇒ Object
11
12
13
|
# File 'lib/behave_fun/decorator.rb', line 11
def child_fail
fail
end
|
#child_running ⇒ Object
15
16
17
|
# File 'lib/behave_fun/decorator.rb', line 15
def child_running
running
end
|
#child_success ⇒ Object
7
8
9
|
# File 'lib/behave_fun/decorator.rb', line 7
def child_success
success
end
|
#execute ⇒ Object
3
4
5
|
# File 'lib/behave_fun/decorator.rb', line 3
def execute
children[0].run
end
|