Class: Jidoka::Supervisor::Step
- Inherits:
-
Object
- Object
- Jidoka::Supervisor::Step
- Defined in:
- lib/jidoka/supervisor/step.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #_down ⇒ Object
- #_notify ⇒ Object
- #down(&block) ⇒ Object
-
#initialize(caller) ⇒ Step
constructor
A new instance of Step.
- #notify(&block) ⇒ Object
- #up(&block) ⇒ Object
Constructor Details
#initialize(caller) ⇒ Step
Returns a new instance of Step.
6 7 8 |
# File 'lib/jidoka/supervisor/step.rb', line 6 def initialize(caller) @caller = caller end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
4 5 6 |
# File 'lib/jidoka/supervisor/step.rb', line 4 def result @result end |
Instance Method Details
#_down ⇒ Object
14 15 16 |
# File 'lib/jidoka/supervisor/step.rb', line 14 def _down @caller.instance_exec(@result, &@down) if @down.present? end |
#_notify ⇒ Object
22 23 24 |
# File 'lib/jidoka/supervisor/step.rb', line 22 def _notify @caller.instance_exec(@result, &@notify) if @notify.present? end |
#down(&block) ⇒ Object
18 19 20 |
# File 'lib/jidoka/supervisor/step.rb', line 18 def down(&block) @down = block end |
#notify(&block) ⇒ Object
26 27 28 |
# File 'lib/jidoka/supervisor/step.rb', line 26 def notify(&block) @notify = block end |
#up(&block) ⇒ Object
10 11 12 |
# File 'lib/jidoka/supervisor/step.rb', line 10 def up(&block) @result = @caller.instance_eval(&block) end |