Sha256: ec338be72aeff61600f5163c42db424e582af64e2ce6f4d80e77acfc5a588590

Contents?: true

Size: 375 Bytes

Versions: 3

Compression:

Stored size: 375 Bytes

Contents

# frozen_string_literal: true

require 'fluxus/runner'

module Fluxus
  module Safe
    class Caller < Runner
      def self.call!(...)
        instance = new
        __call__(instance, ...)
      rescue StandardError => e
        raise e if e.is_a?(ResultTypeNotDefinedError)

        instance.Failure(type: :exception, result: { exception: e })
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fluxus-1.0.0 lib/fluxus/safe/caller.rb
fluxus-0.1.2 lib/fluxus/safe/caller.rb
fluxus-0.1.0 lib/fluxus/safe/caller.rb