Class: Spoom::Deadcode::Plugins::Ruby
- Extended by:
- T::Sig
- Defined in:
- lib/spoom/deadcode/plugins/ruby.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
ignore_classes_inheriting_from, ignore_classes_named, ignore_constants_named, ignore_methods_named, ignore_modules_named, #initialize, #internal_on_define_accessor, #internal_on_define_class, #internal_on_define_constant, #internal_on_define_method, #internal_on_define_module, #on_define_accessor, #on_define_class, #on_define_constant, #on_define_method, #on_define_module
Constructor Details
This class inherits a constructor from Spoom::Deadcode::Plugins::Base
Instance Method Details
#on_send(send) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/spoom/deadcode/plugins/ruby.rb', line 24 def on_send(send) case send.name when "const_defined?", "const_get", "const_source_location" reference_symbol_as_constant(send, T.must(send.args.first)) when "send", "__send__", "try" arg = send.args.first @index.reference_method(arg.unescaped, send.location) if arg.is_a?(Prism::SymbolNode) when "alias_method" last_arg = send.args.last if last_arg.is_a?(Prism::SymbolNode) || last_arg.is_a?(Prism::StringNode) @index.reference_method(last_arg.unescaped, send.location) end when "method" arg = send.args.first @index.reference_method(arg.unescaped, send.location) if arg.is_a?(Prism::SymbolNode) end end |