Class: Controll::Executor::Controlled

Inherits:
Delegator show all
Defined in:
lib/controll/executor/controlled.rb

Instance Attribute Summary

Attributes inherited from Assistant

#controller, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Assistant

controller_methods, #initialize

Constructor Details

This class inherits a constructor from Controll::Assistant

Class Method Details

.execute(&block) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/controll/executor/controlled.rb', line 18

def execute &block
  define_method :execute do
    super
    instance_eval &block
    result
  end
end

Instance Method Details

#executeObject



6
7
8
9
# File 'lib/controll/executor/controlled.rb', line 6

def execute
  validations
  do_command unless error?
end

#resultObject

return last notification or :success as result return <Event>



13
14
15
# File 'lib/controll/executor/controlled.rb', line 13

def result
  main_event
end