Class: Nitpick::Warnings::RescueEverything
- Inherits:
-
SimpleWarning
- Object
- SimpleWarning
- Nitpick::Warnings::RescueEverything
- Defined in:
- lib/nitpick/warnings/rescue_everything.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ RescueEverything
constructor
A new instance of RescueEverything.
- #matches? ⇒ Boolean
- #message ⇒ Object
Methods inherited from SimpleWarning
Constructor Details
#initialize(*args) ⇒ RescueEverything
Returns a new instance of RescueEverything.
4 5 6 |
# File 'lib/nitpick/warnings/rescue_everything.rb', line 4 def initialize(*args) @exceptions, @rescue_value = args end |
Instance Method Details
#matches? ⇒ Boolean
8 9 10 11 12 13 |
# File 'lib/nitpick/warnings/rescue_everything.rb', line 8 def matches? return false unless @exceptions [:Object, :Exception].find do |const| @exceptions.include? [:const, const] end end |
#message ⇒ Object
15 16 17 |
# File 'lib/nitpick/warnings/rescue_everything.rb', line 15 def "A rescue is capturing Object or Exception, which may hide errors." end |