Class: RDocRuboCop::Lang::C::Comment::Normal

Inherits:
RDocRuboCop::Lang::C::Comment show all
Defined in:
lib/rdoc_rubocop/lang/c/comment/normal.rb

Overview

This class manages comments of the following form:

/*
 * Document-class: Foo
 *
 *   code1
 *   code2
 */

Instance Attribute Summary

Attributes inherited from RDocRuboCop::Lang::C::Comment

#comment_text, #offset_begin, #offset_end, #source_file

Instance Method Summary collapse

Methods inherited from RDocRuboCop::Lang::C::Comment

build, #initialize, #length

Methods inherited from Base::Comment

#rdoc, #source_codes

Constructor Details

This class inherits a constructor from RDocRuboCop::Lang::C::Comment

Instance Method Details

#corrected_textObject



20
21
22
23
24
25
26
27
28
# File 'lib/rdoc_rubocop/lang/c/comment/normal.rb', line 20

def corrected_text
  body = rdoc.apply

  first_line = body.slice!(/\A.*\R/)
  body.gsub!(/^/, indent)

  text = "/*#{@indent_after_asterisk}#{first_line}#{body}".gsub(/ *$/, "")
  "#{text}#{@end_str}"
end