Exception: Layo::SyntaxError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Layo::SyntaxError
- Defined in:
- lib/layo/syntax_error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#line ⇒ Object
Returns the value of attribute line.
-
#pos ⇒ Object
Returns the value of attribute pos.
Instance Method Summary collapse
-
#initialize(line, pos, msg) ⇒ SyntaxError
constructor
A new instance of SyntaxError.
- #to_s ⇒ Object
Constructor Details
#initialize(line, pos, msg) ⇒ SyntaxError
Returns a new instance of SyntaxError.
5 6 7 8 |
# File 'lib/layo/syntax_error.rb', line 5 def initialize(line, pos, msg) super(msg) @line, @pos = line, pos end |
Instance Attribute Details
#line ⇒ Object
Returns the value of attribute line.
3 4 5 |
# File 'lib/layo/syntax_error.rb', line 3 def line @line end |
#pos ⇒ Object
Returns the value of attribute pos.
3 4 5 |
# File 'lib/layo/syntax_error.rb', line 3 def pos @pos end |
Instance Method Details
#to_s ⇒ Object
10 11 12 |
# File 'lib/layo/syntax_error.rb', line 10 def to_s super << " on line #{@line}, character #{@pos}" end |