Class: ToeTag::ProcSpec
- Inherits:
-
ExceptionSpec
- Object
- Module
- ExceptionSpec
- ToeTag::ProcSpec
- Defined in:
- lib/toe_tag.rb
Overview
Wraps a proc to allow arbitrary logic when matching an exception.
Instance Method Summary collapse
- #===(except) ⇒ Object
-
#initialize(blk, exception = StandardError) ⇒ ProcSpec
constructor
A new instance of ProcSpec.
Methods included from ExceptionBehavior
Constructor Details
#initialize(blk, exception = StandardError) ⇒ ProcSpec
Returns a new instance of ProcSpec.
89 90 91 92 |
# File 'lib/toe_tag.rb', line 89 def initialize(blk, exception = StandardError) self.exception = exception self.block = blk end |
Instance Method Details
#===(except) ⇒ Object
94 95 96 |
# File 'lib/toe_tag.rb', line 94 def ===(except) exception === except && block[except] end |