Class: Nitpick::Warnings::RescueValue

Class | Nitpick::Warnings::RescueValue
In: | lib/nitpick/warnings/rescue_value.rb
Parent: | SimpleWarning

### Methods

matches? message new

### Public Class methods

new(*args)

[Source]

    # File lib/nitpick/warnings/rescue_value.rb, line 4
          def initialize(*args)
            @exceptions, *@rescue_value = args
          end

### Public Instance methods

matches?()

[Source]

    # File lib/nitpick/warnings/rescue_value.rb, line 8
          def matches?
            return false if @rescue_value.nil?
            return false if @rescue_value.size > 1
            return false if @rescue_value.empty?
            val = @rescue_value.first
            return false if val.nil? or val.empty?
            [:lit, :nil].include? val.first # the value's type
          end

message()

[Source]

    # File lib/nitpick/warnings/rescue_value.rb, line 17
          def message
            "A rescue is returning #{sexp_to_ruby(@rescue_value.first).inspect} directly and may not handle an error."
          end

[Validate]