Class: Steep::Diagnostic::Signature::ClassVariableDuplicationError

Inherits:
Base
  • Object
show all
Defined in:
lib/steep/diagnostic/signature.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#location

Instance Method Summary collapse

Methods inherited from Base

#detail_lines, #diagnostic_code, #path

Methods included from Helper

#error_name, #full_message

Constructor Details

#initialize(class_name:, other_class_name:, variable_name:, location:) ⇒ ClassVariableDuplicationError

Returns a new instance of ClassVariableDuplicationError.



304
305
306
307
308
309
310
# File 'lib/steep/diagnostic/signature.rb', line 304

def initialize(class_name:, other_class_name:, variable_name:, location:)
  super(location: location)

  @class_name = class_name
  @other_class_name = other_class_name
  @variable_name = variable_name
end

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



300
301
302
# File 'lib/steep/diagnostic/signature.rb', line 300

def class_name
  @class_name
end

#other_class_nameObject (readonly)

Returns the value of attribute other_class_name.



301
302
303
# File 'lib/steep/diagnostic/signature.rb', line 301

def other_class_name
  @other_class_name
end

#variable_nameObject (readonly)

Returns the value of attribute variable_name.



302
303
304
# File 'lib/steep/diagnostic/signature.rb', line 302

def variable_name
  @variable_name
end

Instance Method Details

#header_lineObject



312
313
314
# File 'lib/steep/diagnostic/signature.rb', line 312

def header_line
  "Class variable definition `#{variable_name}` in `#{class_name}` may be overtaken by `#{other_class_name}`"
end