Sha256: a1a5dd45e5feaa3f0f46fb91dab4d4f17c4cb56b6056abbf7ab8c070c5acc7fc
Contents?: true
Size: 471 Bytes
Versions: 28
Compression:
Stored size: 471 Bytes
Contents
module Kernel def exceptions_wrapping(error_class) m = Module.new (class << m; self; end).instance_eval do define_method(:===) do |err| err.respond_to?(:original_exception) && error_class === err.original_exception end end m end def exceptions_matching(matcher) m = Module.new (class << m; self; end).instance_eval do define_method(:===) do |err| err.message =~ matcher end end m end end
Version data entries
28 entries across 28 versions & 1 rubygems