Class: RDocRuboCop::Lang::C::Comment::Banner

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

Overview

This class manages comments of the following form:

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

Those whose body is before the column position of the comment start are also included.

/*
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



30
31
32
33
34
35
36
37
# File 'lib/rdoc_rubocop/lang/c/comment/banner.rb', line 30

def corrected_text
  body = rdoc.apply

  text = body.gsub(/^/, indent).gsub(/ *$/, "")
  text = "#{@padding_begin_str}#{text}"

  "#{text}#{@end_str}"
end