Class: RuboCop::CommentConfig::CopAnalysis Private
- Inherits:
-
Struct
- Object
- Struct
- RuboCop::CommentConfig::CopAnalysis
- Defined in:
- lib/rubocop/comment_config/directive_range.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
The per-cop state accumulated while analyzing directives: the disabled ranges so far, plus the line and directive of the currently open disable, if any.
Instance Attribute Summary collapse
-
#line_ranges ⇒ Object
Returns the value of attribute line_ranges.
-
#start_directive ⇒ Object
Returns the value of attribute start_directive.
-
#start_line_number ⇒ Object
Returns the value of attribute start_line_number.
Instance Method Summary collapse
-
#close(line) ⇒ Object
private
The open range (if any) closed at the given line, appended to the accumulated ranges, each remembering the directive that opened it.
Instance Attribute Details
#line_ranges ⇒ Object
Returns the value of attribute line_ranges
22 23 24 |
# File 'lib/rubocop/comment_config/directive_range.rb', line 22 def line_ranges @line_ranges end |
#start_directive ⇒ Object
Returns the value of attribute start_directive
22 23 24 |
# File 'lib/rubocop/comment_config/directive_range.rb', line 22 def start_directive @start_directive end |
#start_line_number ⇒ Object
Returns the value of attribute start_line_number
22 23 24 |
# File 'lib/rubocop/comment_config/directive_range.rb', line 22 def start_line_number @start_line_number end |
Instance Method Details
#close(line) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The open range (if any) closed at the given line, appended to the accumulated ranges, each remembering the directive that opened it.
25 26 27 28 29 |
# File 'lib/rubocop/comment_config/directive_range.rb', line 25 def close(line) return line_ranges unless start_line_number line_ranges + [DirectiveRange.new(start_line_number, line, start_directive)] end |