Class: RuboCop::CommentConfig::DirectiveRange Private

Inherits:
Range
  • Object
show all
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.

A disabled line range that remembers the directive comment that opened it. Value-equal to a plain Range, so consumers comparing or hashing ranges are unaffected.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(first_line, last_line, directive) ⇒ DirectiveRange

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.

Returns a new instance of DirectiveRange.



12
13
14
15
# File 'lib/rubocop/comment_config/directive_range.rb', line 12

def initialize(first_line, last_line, directive)
  super(first_line, last_line)
  @directive = directive
end

Instance Attribute Details

#directiveObject (readonly)

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.



10
11
12
# File 'lib/rubocop/comment_config/directive_range.rb', line 10

def directive
  @directive
end