Sha256: f7d0eafcc6b490e5435ade1107e1f9a9bcaab4bac4cae2be5b43d7745a10dbc8

Contents?: true

Size: 389 Bytes

Versions: 8

Compression:

Stored size: 389 Bytes

Contents

# frozen_string_literal: true

require 'dry/effects/instruction'

module Dry
  module Effects
    module Instructions
      class Raise < Instruction
        attr_reader :error

        def initialize(error)
          @error = error
        end

        def call
          raise error
        end
      end

      def self.Raise(error)
        Raise.new(error)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dry-effects-0.1.5 lib/dry/effects/instructions/raise.rb
dry-effects-0.1.4 lib/dry/effects/instructions/raise.rb
dry-effects-0.1.3 lib/dry/effects/instructions/raise.rb
dry-effects-0.1.2 lib/dry/effects/instructions/raise.rb
dry-effects-0.1.1 lib/dry/effects/instructions/raise.rb
dry-effects-0.1.0 lib/dry/effects/instructions/raise.rb
dry-effects-0.1.0.alpha2 lib/dry/effects/instructions/raise.rb
dry-effects-0.1.0.alpha lib/dry/effects/instructions/raise.rb