Exception: WLang::UndefinedVariableError
Overview
Raised when a variable may not be found in the current parser scope
Instance Attribute Summary (collapse)
-
- (Object) variable
Name of the variable that could not be found.
Attributes inherited from EvalError
Attributes inherited from Error
Instance Method Summary (collapse)
-
- (UndefinedVariableError) initialize(msg = nil, parser_state = nil, expression = nil, variable = nil)
constructor
Creates an error instance with an optional variable name.
- - (Object) to_s
Methods inherited from Error
Constructor Details
- (UndefinedVariableError) initialize(msg = nil, parser_state = nil, expression = nil, variable = nil)
Creates an error instance with an optional variable name
61 62 63 64 |
# File 'lib/wlang/errors.rb', line 61 def initialize(msg = nil, parser_state = nil, expression = nil, variable = nil) super(msg, parser_state, expression) @variable = variable end |
Instance Attribute Details
- (Object) variable
Name of the variable that could not be found
58 59 60 |
# File 'lib/wlang/errors.rb', line 58 def variable @variable end |
Instance Method Details
- (Object) to_s
66 67 68 |
# File 'lib/wlang/errors.rb', line 66 def to_s "Unable to find variable #{@variable}" end |