Class: BehaveFun::Decorator

Inherits:
Task
  • Object
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

Methods included from TaskSerializer

#as_json, #dump_status, #name, #restore_status, #serializable_status_fields

Constructor Details

This class inherits a constructor from BehaveFun::Task

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_failObject



11
12
13
# File 'lib/behave_fun/decorator.rb', line 11

def child_fail
  fail
end

#child_runningObject



15
16
17
# File 'lib/behave_fun/decorator.rb', line 15

def child_running
  running
end

#child_successObject



7
8
9
# File 'lib/behave_fun/decorator.rb', line 7

def child_success
  success
end

#executeObject



3
4
5
# File 'lib/behave_fun/decorator.rb', line 3

def execute
  children[0].run
end