Sha256: 4cc737beda7720c40df70d530e2b153f5f5c643095ecb34a1cbb8f06ba58290a

Contents?: true

Size: 525 Bytes

Versions: 27

Compression:

Stored size: 525 Bytes

Contents

module Foobara
  class Command
    module Concerns
      module Result
        include Concern

        class CouldNotProcessResult < Outcome::UnsuccessfulOutcomeError; end

        private

        def process_result_using_result_type(result)
          return result unless result_type

          outcome = result_type.process_value(result)

          if outcome.success?
            outcome.result
          else
            raise CouldNotProcessResult, outcome.errors
          end
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
foobara-0.0.7 projects/command/src/concerns/result.rb
foobara-0.0.6 projects/command/src/concerns/result.rb
foobara-0.0.5 projects/command/src/concerns/result.rb
foobara-0.0.4 projects/command/src/concerns/result.rb
foobara-0.0.3 projects/command/src/concerns/result.rb
foobara-0.0.2 projects/command/src/concerns/result.rb
foobara-0.0.1 projects/command/src/concerns/result.rb