module Kleisli::Conversions::ToValidation

Constants

GetEx
GetLeft
GetRight
GetVal

Public Class Methods

enrich(o_self, sc, fc, sp , fp) click to toggle source
# File lib/kleisli/conversions.rb, line 58
def self.enrich(o_self, sc, fc, sp , fp)
  o_self.send(:define_method, :to_validation) do
    case
    when is_a?(sc)
      Success(sp.call(self))
    when is_a?(fc)
      Failure(fp.call(self))
    end
  end
end