Class: RDocRuboCop::Lang::Ruby::CommentExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/rdoc_rubocop/lang/ruby/comment_extractor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_file) ⇒ CommentExtractor

Returns a new instance of CommentExtractor.



11
12
13
14
# File 'lib/rdoc_rubocop/lang/ruby/comment_extractor.rb', line 11

def initialize(source_file)
  @source_file = source_file
  @comments = []
end

Instance Attribute Details

#commentsObject (readonly)

Returns the value of attribute comments.



9
10
11
# File 'lib/rdoc_rubocop/lang/ruby/comment_extractor.rb', line 9

def comments
  @comments
end

Instance Method Details

#extractObject



16
17
18
# File 'lib/rdoc_rubocop/lang/ruby/comment_extractor.rb', line 16

def extract
  @comments = extract_comments
end