Exception: RLTK::TypeMismatch
- Defined in:
- lib/rltk/ast.rb
Overview
A TypeMismatch is raised when an object being set as a child or value of an ASTNode is of the wrong type.
Instance Method Summary collapse
-
#initialize(expected, actual) ⇒ TypeMismatch
constructor
Instantiates a new TypeMismatch object.
-
#to_s ⇒ String
String representation of the error.
Constructor Details
#initialize(expected, actual) ⇒ TypeMismatch
Instantiates a new TypeMismatch object.
26 27 28 29 |
# File 'lib/rltk/ast.rb', line 26 def initialize(expected, actual) @expected = expected @actual = actual end |
Instance Method Details
#to_s ⇒ String
Returns String representation of the error.
32 33 34 |
# File 'lib/rltk/ast.rb', line 32 def to_s "Type Mismatch: Expected #{@expected} but received #{@actual}." end |