Module: RuboCop::Cop::Metz::OnSendCsendBridge

Included in:
DemeterTrainWreck, ViewsDeepNavigation
Defined in:
lib/rubocop/cop/metz/on_send_csend_bridge.rb

Overview

Gives a cop identical send and csend dispatch when it defines on_send, preserving the project-wide safe-navigation invariant.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



9
10
11
12
# File 'lib/rubocop/cop/metz/on_send_csend_bridge.rb', line 9

def self.included(base)
  base.extend(ClassMethods)
  base.alias_method(:on_csend, :on_send) if base.method_defined?(:on_send)
end