Sha256: 856ad9d07279975313e4631d0f4fd34168da2cd45db989ab8131dc22cc241282

Contents?: true

Size: 331 Bytes

Versions: 1

Compression:

Stored size: 331 Bytes

Contents

# frozen_string_literal: true

require 'dry/monads/result'

module Dry
  module Schema
    class Result
      include Dry::Monads::Result::Mixin

      def to_monad(options = EMPTY_HASH)
        if success?
          Success(output)
        else
          Failure(message_set(options).to_h)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dry-schema-0.4.0 lib/dry/schema/extensions/monads.rb