Class: RuboCop::Cop::CableReady::UnusedCableReadyCall

Inherits:
Base
  • Object
show all
Defined in:
lib/rubocop/cop/cable_ready/unused_cable_ready_call.rb

Constant Summary collapse

MSG =
"unused `cable_ready` call"

Instance Method Summary collapse

Methods inherited from Base

inherited

Instance Method Details

#on_send(definition) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/rubocop/cop/cable_ready/unused_cable_ready_call.rb', line 9

def on_send(definition)
  return if definition.method_name != :cable_ready

  call = definition.ancestors.first

  return if call.instance_of? RuboCop::AST::SendNode

  add_offense(definition)
end