class RuboCop::Cop::Style::Documentation
def nodoc_comment?(node, ast_with_comments, require_all = false)
Note: How end-of-line comments are associated with code changed in
proceeds to check its ancestors for :nodoc: all.
class/module. Unless the element is tagged with :nodoc:, the search
First checks if the :nodoc: comment is associated with the
def nodoc_comment?(node, ast_with_comments, require_all = false) return false unless node nodoc_node = node.children.first return false unless nodoc_node comment = ast_with_comments[nodoc_node].first if comment && comment.loc.line == node.loc.line regex = /^#\s*:nodoc:#{"\s+all\s*$" if require_all}/ return true if comment.text =~ regex end nodoc_comment?(node.ancestors.first, ast_with_comments, true) end