Class: Codeowners::Checker::Group::Comment
- Defined in:
- lib/codeowners/checker/group/comment.rb
Overview
Define and manage comment line.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Line
Class Method Summary collapse
-
.match?(line) ⇒ Boolean
Matches if the line is a comment.
Instance Method Summary collapse
-
#level ⇒ Integer
Return the comment level if the comment works like a markdown headers.
Methods inherited from Line
#<=>, #==, build, #initialize, #pattern?, #remove!, subclasses, #to_content, #to_file, #to_s, #to_tree
Constructor Details
This class inherits a constructor from Codeowners::Checker::Group::Line
Class Method Details
.match?(line) ⇒ Boolean
Matches if the line is a comment.
12 13 14 |
# File 'lib/codeowners/checker/group/comment.rb', line 12 def self.match?(line) line.start_with?('#') end |
Instance Method Details
#level ⇒ Integer
Return the comment level if the comment works like a markdown headers.
23 24 25 |
# File 'lib/codeowners/checker/group/comment.rb', line 23 def level (@line[/^#+/] || '').size end |