Class: Deprecool::Finders::Ruby::V4_0_0::ToSetArguments

Inherits:
Deprecool::Finder show all
Defined in:
lib/deprecool/finders/ruby/v4.0.0/to_set_arguments.rb

Instance Attribute Summary

Attributes inherited from Deprecool::Finder

#file_path, #source

Instance Method Summary collapse

Methods inherited from Deprecool::Finder

affected_version_range, classname, effort, hook_methods, id, inherited, #initialize

Methods included from PrismHelpers

#unwrap_arguments, #unwrap_array, #unwrap_children, #unwrap_class, #unwrap_parentheses

Constructor Details

This class inherits a constructor from Deprecool::Finder

Instance Method Details

#on_call_node(node) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/deprecool/finders/ruby/v4.0.0/to_set_arguments.rb', line 19

def on_call_node(node)
  return unless node.name == :to_set
  return unless node.arguments

  confidence = confidence_from_receiver_node(node.receiver)
  return unless confidence

  add_offense(node, confidence:)
end