module Ytry

Constants

VERSION

Public Instance Methods

Try() { || ... } click to toggle source
# File lib/ytry.rb, line 4
def Try
  raise ArgumentError, 'missing block' unless block_given?
  begin
    Success.new(yield)
  rescue StandardError => e
    Failure.new(e)
  end
end