Class: Steep::Diagnostic::Ruby::UnknownGlobalVariable

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:) ⇒ UnknownGlobalVariable

Returns a new instance of UnknownGlobalVariable.



649
650
651
652
# File 'lib/steep/diagnostic/ruby.rb', line 649

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.



647
648
649
# File 'lib/steep/diagnostic/ruby.rb', line 647

def name
  @name
end

Instance Method Details

#header_lineObject



654
655
656
# File 'lib/steep/diagnostic/ruby.rb', line 654

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