Class: Dry::Effects::Providers::Interrupt
- Inherits:
-
Object
- Object
- Dry::Effects::Providers::Interrupt
- Defined in:
- lib/dry/effects/providers/interrupt.rb
Instance Method Summary collapse
-
#call ⇒ Object
private
Yield the block with the handler installed.
- #halt ⇒ Object
- #interrupt(*payload) ⇒ Object
- #provide?(effect) ⇒ Boolean
- #represent ⇒ String
Instance Method Details
#call ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Yield the block with the handler installed
14 15 16 17 18 |
# File 'lib/dry/effects/providers/interrupt.rb', line 14 def call [false, yield] rescue halt => e [true, e.payload[0]] end |
#halt ⇒ Object
20 |
# File 'lib/dry/effects/providers/interrupt.rb', line 20 def halt = Halt[scope] |
#interrupt(*payload) ⇒ Object
9 |
# File 'lib/dry/effects/providers/interrupt.rb', line 9 def interrupt(*payload) = Instructions.Raise(halt.new(payload)) |
#provide?(effect) ⇒ Boolean
29 |
# File 'lib/dry/effects/providers/interrupt.rb', line 29 def provide?(effect) = super && scope.equal?(effect.scope) |
#represent ⇒ String
24 |
# File 'lib/dry/effects/providers/interrupt.rb', line 24 def represent = "interrupt[#{scope}]" |