Sha256: fa44887798fe526832ca22435eea72da4485851feeee42b0c6483aea28c04769
Contents?: true
Size: 686 Bytes
Versions: 12
Compression:
Stored size: 686 Bytes
Contents
# frozen_string_literal: true require "dry/monads/result" module Dry module Validation # Monad extension for contract results # # @example # Dry::Validation.load_extensions(:monads) # # contract = Dry::Validation::Contract.build do # schema do # required(:name).filled(:string) # end # end # # contract.call(name: nil).to_monad # # @api public class Result include Dry::Monads::Result::Mixin # Returns a result monad # # @return [Dry::Monads::Result] # # @api public def to_monad success? ? Success(self) : Failure(self) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems