Class: Steep::Diagnostic::Ruby::UnknownInstanceVariable

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

Instance Attribute Summary collapse

Attributes inherited from Base

#location, #node

Instance Method Summary collapse

Methods inherited from Base

#detail_lines, #diagnostic_code

Methods included from Helper

#error_name, #full_message

Constructor Details

#initialize(node:, name:) ⇒ UnknownInstanceVariable

Returns a new instance of UnknownInstanceVariable.



636
637
638
639
# File 'lib/steep/diagnostic/ruby.rb', line 636

def initialize(node:, name:)
  super(node: node, location: node.loc.name)  # steep:ignore NoMethod
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



634
635
636
# File 'lib/steep/diagnostic/ruby.rb', line 634

def name
  @name
end

Instance Method Details

#header_lineObject



641
642
643
# File 'lib/steep/diagnostic/ruby.rb', line 641

def header_line
  "Cannot find the declaration of instance variable: `#{name}`"
end