class RuboCop::AST::ProcessedSource

def contains_comment?(source_range)

Returns:
  • (Boolean) - if any of the lines in the given `source_range` has a comment.
def contains_comment?(source_range)
  each_comment_in_lines(source_range.line..source_range.last_line).any?
end