Method: RuboCop::Cop::AnnotationComment#bounds

Defined in:
lib/rubocop/cop/mixin/annotation_comment.rb

#boundsObject

Returns the range bounds for just the annotation



29
30
31
32
33
# File 'lib/rubocop/cop/mixin/annotation_comment.rb', line 29

def bounds
  start = comment.source_range.begin_pos + margin.length
  length = [keyword, colon, space].reduce(0) { |len, elem| len + elem.to_s.length }
  [start, start + length]
end