Class: RuboCop::CommentConfig::ConfigDisabledCopDirectiveComment

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

Instance Method Summary collapse

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_numberObject (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

#locObject (readonly)

Returns the value of attribute loc.



14
15
16
# File 'lib/rubocop/comment_config.rb', line 14

def loc
  @loc
end

#textObject (readonly)

Returns the value of attribute text.



14
15
16
# File 'lib/rubocop/comment_config.rb', line 14

def text
  @text
end