Method: RuboCop::Cop::Primer::ComponentNameMigration#on_send

Defined in:
lib/rubocop/cop/primer/component_name_migration.rb

#on_send(node) ⇒ Object

[View source]

18
19
20
21
22
23
# File 'lib/rubocop/cop/primer/component_name_migration.rb', line 18

def on_send(node)
  return unless node.method_name == :new && !node.receiver.nil? && ::Primer::Deprecations.deprecated?(node.receiver.const_name)

  message = ::Primer::Deprecations.deprecation_message(node.receiver.const_name)
  add_offense(node.receiver, message: message)
end