vendor/jruby/1.9/gems/rubocop-0.25.0/lib/rubocop/cop/style/documentation.rb
# Returns true if the node has a comment on the line above it that
# isn't an annotation.
Returns true if the node has a comment on the line above it that
isn't an annotation.
Returns true if the node has a comment on the line above it that isn ' t an annotation .
def associated_comment?(node, ast_with_comments)
          return false if ast_with_comments[node].empty?
          preceding_comment = ast_with_comments[node].last
          distance = node.loc.keyword.line - preceding_comment.loc.line
          return false if distance > 1
          ast_with_comments[node].any? { |comment| !annotation?(comment) }
        end
def associated_comment? ( node , ast_with_comments ) return false if ast_with_comments [ node ] . empty? preceding_comment = ast_with_comments [ node ] . last distance = node . loc . keyword . line - preceding_comment . loc . line return false if distance > 1 ast_with_comments [ node ] . any? { | comment | ! annotation? ( comment ) } end
Returns true if the node has a comment on the line above it that
isn't an annotation.
Returns true if the node has a comment on the line above it that isn ' t an annotation .
# As long as there's at least one comment line that isn't an # annotation, it's OK.
node
ast_with_comments