Module: Isolator::Callbacks
- Included in:
- Isolator
- Defined in:
- lib/isolator/callbacks.rb
Overview
Add before_isolate and after_isolate callbacks
Instance Method Summary collapse
- #after_isolate(&block) ⇒ Object
- #after_isolate_callbacks ⇒ Object
- #before_isolate(&block) ⇒ Object
- #before_isolate_callbacks ⇒ Object
- #finish! ⇒ Object
- #start! ⇒ Object
Instance Method Details
#after_isolate(&block) ⇒ Object
10 11 12 |
# File 'lib/isolator/callbacks.rb', line 10 def after_isolate(&block) after_isolate_callbacks << block end |
#after_isolate_callbacks ⇒ Object
28 29 30 |
# File 'lib/isolator/callbacks.rb', line 28 def after_isolate_callbacks @after_isolate_callbacks ||= [] end |
#before_isolate(&block) ⇒ Object
6 7 8 |
# File 'lib/isolator/callbacks.rb', line 6 def before_isolate(&block) before_isolate_callbacks << block end |
#before_isolate_callbacks ⇒ Object
24 25 26 |
# File 'lib/isolator/callbacks.rb', line 24 def before_isolate_callbacks @before_isolate_callbacks ||= [] end |
#finish! ⇒ Object
19 20 21 22 |
# File 'lib/isolator/callbacks.rb', line 19 def finish! return if Isolator.disabled? after_isolate_callbacks.each(&:call) end |
#start! ⇒ Object
14 15 16 17 |
# File 'lib/isolator/callbacks.rb', line 14 def start! return if Isolator.disabled? before_isolate_callbacks.each(&:call) end |