Class: RuboCop::CommentConfig::ConfigDisabledCopDirectiveComment
- Inherits:
-
Object
- Object
- RuboCop::CommentConfig::ConfigDisabledCopDirectiveComment
- Includes:
- Ext::Comment
- 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.
Methods included from Ext::Comment
Constructor Details
#initialize(cop_name) ⇒ ConfigDisabledCopDirectiveComment
Returns a new instance of ConfigDisabledCopDirectiveComment.
21 22 23 24 25 |
# File 'lib/rubocop/comment_config.rb', line 21 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.
16 17 18 |
# File 'lib/rubocop/comment_config.rb', line 16 def line_number @line_number end |
#loc ⇒ Object (readonly)
Returns the value of attribute loc.
16 17 18 |
# File 'lib/rubocop/comment_config.rb', line 16 def loc @loc end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
16 17 18 |
# File 'lib/rubocop/comment_config.rb', line 16 def text @text end |