class RuboCop::Cop::Style::AutoResourceCleanup
def on_send(node)
def on_send(node) TARGET_METHODS.each do |target_class, target_method| next if node.method_name != target_method target_receiver = s(:const, nil, target_class) next if node.receiver != target_receiver next if cleanup?(node) add_offense(node, message: format(MSG, class: target_class, method: target_method)) end end