class RuboCop::AST::NodePattern::Node

def nb_captures

Returns:
  • (Integer) - nb of captures of that node and its descendants
def nb_captures
  children_nodes.sum(&:nb_captures)
end