Class: Rubyzen::Collections::RaisesCollection
- Inherits:
-
BaseCollection
- Object
- Array
- BaseCollection
- Rubyzen::Collections::RaisesCollection
- Defined in:
- lib/rubyzen/collections/raises_collection.rb
Overview
Collection of raise declarations found in methods or classes.
Instance Method Summary collapse
-
#with_exception_type(exception_class) ⇒ RaisesCollection
Filters raises that include the given exception class.
-
#with_string ⇒ RaisesCollection
Filters raises that use a plain string message (not an exception class).
Methods inherited from BaseCollection
Instance Method Details
#with_exception_type(exception_class) ⇒ RaisesCollection
Filters raises that include the given exception class.
19 20 21 22 23 |
# File 'lib/rubyzen/collections/raises_collection.rb', line 19 def with_exception_type(exception_class) filter do |raise_declaration| raise_declaration.exception_types.include?(exception_class) end end |
#with_string ⇒ RaisesCollection
Filters raises that use a plain string message (not an exception class).
11 12 13 |
# File 'lib/rubyzen/collections/raises_collection.rb', line 11 def with_string filter(&:with_string?) end |