Class: Steep::Diagnostic::Ruby::UnknownConstantAssigned
- Defined in:
- lib/steep/diagnostic/deprecated/unknown_constant_assigned.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Base
Instance Method Summary collapse
- #header_line ⇒ Object
-
#initialize(node:, context:, name:) ⇒ UnknownConstantAssigned
constructor
A new instance of UnknownConstantAssigned.
Methods inherited from Base
#detail_lines, #diagnostic_code
Methods included from Helper
Constructor Details
#initialize(node:, context:, name:) ⇒ UnknownConstantAssigned
Returns a new instance of UnknownConstantAssigned.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/steep/diagnostic/deprecated/unknown_constant_assigned.rb', line 10 def initialize(node:, context:, name:) const = node.children[0] loc = if const const.loc.expression.join(node.loc.name) else node.loc.name end super(node: node, location: loc) @context = context @name = name end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
7 8 9 |
# File 'lib/steep/diagnostic/deprecated/unknown_constant_assigned.rb', line 7 def context @context end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/steep/diagnostic/deprecated/unknown_constant_assigned.rb', line 8 def name @name end |
Instance Method Details
#header_line ⇒ Object
22 23 24 |
# File 'lib/steep/diagnostic/deprecated/unknown_constant_assigned.rb', line 22 def header_line "Cannot find the declaration of constant `#{name}`" end |