class EHandl::ResultCase
Public Class Methods
new(expr) { |success| ... }
click to toggle source
# File lib/ehandl.rb, line 32 def initialize(expr) begin @result = expr.call yield(Success.new(@result)) rescue Exception => ex @result = ex yield(Failure.new(@result)) end end