class Dry::Effects::Providers::Interrupt

Public Instance Methods

call() { |]| ... } click to toggle source

Yield the block with the handler installed

@api private

# File lib/dry/effects/providers/interrupt.rb, line 20
def call
  [false, yield]
rescue halt => e
  [true, e.payload[0]]
end
halt() click to toggle source
# File lib/dry/effects/providers/interrupt.rb, line 26
def halt
  Halt[scope]
end
interrupt(*payload) click to toggle source
# File lib/dry/effects/providers/interrupt.rb, line 13
def interrupt(*payload)
  Instructions.Raise(halt.new(payload))
end
provide?(effect) click to toggle source

@param [Effect] effect @return [Boolean] @api public

Calls superclass method
# File lib/dry/effects/providers/interrupt.rb, line 39
def provide?(effect)
  super && scope.equal?(effect.scope)
end
represent() click to toggle source

@return [String] @api public

# File lib/dry/effects/providers/interrupt.rb, line 32
def represent
  "interrupt[#{scope}]"
end