module RuboCop::Cop::NilMethods

This module provides a list of methods that are:

  1. In the NilClass by default

  2. Added to NilClass by explicitly requiring any standard libraries

  3. Cop's configuration parameter Whitelist.

Private Instance Methods

nil_methods() click to toggle source
# File lib/rubocop/cop/mixin/nil_methods.rb, line 12
def nil_methods
  nil.methods + other_stdlib_methods + whitelist
end
other_stdlib_methods() click to toggle source
# File lib/rubocop/cop/mixin/nil_methods.rb, line 16
def other_stdlib_methods
  [:to_d]
end
whitelist() click to toggle source
# File lib/rubocop/cop/mixin/nil_methods.rb, line 20
def whitelist
  cop_config['Whitelist'].map(&:to_sym)
end