Sha256: fdd991c72d7ca7cd997b81fea97756a7b04dac689146a19ede0c0d3d6d996acd
Contents?: true
Size: 480 Bytes
Versions: 11
Compression:
Stored size: 480 Bytes
Contents
# frozen_string_literal: true module Pipeable module Steps # Sends a risky message to an object which may pass or fail. class Try < Abstract def initialize(*, catch:, **) super(*, **) @catch = catch end def call result result.fmap { |object| object.public_send(*base_positionals, **base_keywords) } rescue *Array(catch) => error Failure error end private attr_reader :catch end end end
Version data entries
11 entries across 11 versions & 1 rubygems