Class: Jade::Frontend::SemanticAnalysis::Error::VariableNotFound

Inherits:
Error
  • Object
show all
Defined in:
lib/jade/frontend/semantic_analysis/error/variable_not_found.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#entry, #span

Instance Method Summary collapse

Methods inherited from Error

#candidates, #notes, #queried_name, #to_diagnostic

Constructor Details

#initialize(entry, span, name:, causes: []) ⇒ VariableNotFound

Returns a new instance of VariableNotFound.



8
9
10
11
12
# File 'lib/jade/frontend/semantic_analysis/error/variable_not_found.rb', line 8

def initialize(entry, span, name:, causes: [])
  @name = name
  @causes = causes
  super(entry:, span:)
end

Instance Attribute Details

#causesObject (readonly)

Returns the value of attribute causes.



6
7
8
# File 'lib/jade/frontend/semantic_analysis/error/variable_not_found.rb', line 6

def causes
  @causes
end

Instance Method Details

#labelObject



18
19
20
# File 'lib/jade/frontend/semantic_analysis/error/variable_not_found.rb', line 18

def label
  "not found"
end

#messageObject



14
15
16
# File 'lib/jade/frontend/semantic_analysis/error/variable_not_found.rb', line 14

def message
  "I cannot find a `#{@name}` variable"
end