Class: RuboCop::CommentConfig::ConfigDisabledCopDirectiveComment
- Inherits:
-
Object
- Object
- RuboCop::CommentConfig::ConfigDisabledCopDirectiveComment
- Defined in:
- lib/rubocop/comment_config.rb
Overview
This class provides an API compatible with RuboCop::DirectiveComment to be used for cops that are disabled in the config file
Defined Under Namespace
Classes: Expression, Loc
Instance Attribute Summary collapse
-
#line_number ⇒ Object
readonly
Returns the value of attribute line_number.
-
#loc ⇒ Object
readonly
Returns the value of attribute loc.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(cop_name) ⇒ ConfigDisabledCopDirectiveComment
constructor
A new instance of ConfigDisabledCopDirectiveComment.
Constructor Details
#initialize(cop_name) ⇒ ConfigDisabledCopDirectiveComment
Returns a new instance of ConfigDisabledCopDirectiveComment.
19 20 21 22 23 |
# File 'lib/rubocop/comment_config.rb', line 19 def initialize(cop_name) @text = "# rubocop:disable #{cop_name}" @line_number = CONFIG_DISABLED_LINE_RANGE_MIN @loc = Loc.new(Expression.new(CONFIG_DISABLED_LINE_RANGE_MIN)) end |
Instance Attribute Details
#line_number ⇒ Object (readonly)
Returns the value of attribute line_number.
14 15 16 |
# File 'lib/rubocop/comment_config.rb', line 14 def line_number @line_number end |
#loc ⇒ Object (readonly)
Returns the value of attribute loc.
14 15 16 |
# File 'lib/rubocop/comment_config.rb', line 14 def loc @loc end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
14 15 16 |
# File 'lib/rubocop/comment_config.rb', line 14 def text @text end |