Sha256: 6a555f166422db7f20a4c6e499a8b5c5890f365137c37ac174dbf40e5211764c

Contents?: true

Size: 390 Bytes

Versions: 22

Compression:

Stored size: 390 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    # This module provides a list of methods that are either in the NilClass,
    # or in the cop's configuration parameter Whitelist.
    module NilMethods
      private

      def nil_methods
        nil.methods + whitelist
      end

      def whitelist
        cop_config['Whitelist'].map(&:to_sym)
      end
    end
  end
end

Version data entries

22 entries across 20 versions & 3 rubygems

Version Path
rubocop-0.62.0 lib/rubocop/cop/mixin/nil_methods.rb
rubocop-0.61.1 lib/rubocop/cop/mixin/nil_methods.rb
rubocop-0.61.0 lib/rubocop/cop/mixin/nil_methods.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/rubocop-0.60.0/lib/rubocop/cop/mixin/nil_methods.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/rubocop-0.60.0/lib/rubocop/cop/mixin/nil_methods.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/rubocop-0.60.0/lib/rubocop/cop/mixin/nil_methods.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/rubocop-0.60.0/lib/rubocop/cop/mixin/nil_methods.rb
rubocop-0.60.0 lib/rubocop/cop/mixin/nil_methods.rb
rubocop-0.59.2 lib/rubocop/cop/mixin/nil_methods.rb
rubocop-0.59.1 lib/rubocop/cop/mixin/nil_methods.rb
rubocop-0.59.0 lib/rubocop/cop/mixin/nil_methods.rb
rubocop-0.58.2 lib/rubocop/cop/mixin/nil_methods.rb
rubocop-0.58.1 lib/rubocop/cop/mixin/nil_methods.rb
rubocop-0.58.0 lib/rubocop/cop/mixin/nil_methods.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/rubocop-0.57.2/lib/rubocop/cop/mixin/nil_methods.rb
rubocop-0.57.2 lib/rubocop/cop/mixin/nil_methods.rb
rubocop-0.57.1 lib/rubocop/cop/mixin/nil_methods.rb
rubocop-0.57.0 lib/rubocop/cop/mixin/nil_methods.rb
rubocop-0.56.0 lib/rubocop/cop/mixin/nil_methods.rb
rubocop-0.55.0 lib/rubocop/cop/mixin/nil_methods.rb