Exception: ComponentEmbeddedRuby::UnexpectedTokenError
- Inherits:
-
StandardError
- Object
- StandardError
- ComponentEmbeddedRuby::UnexpectedTokenError
- Defined in:
- lib/component_embedded_ruby/unexpected_token_error.rb
Instance Attribute Summary collapse
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#got ⇒ Object
readonly
Returns the value of attribute got.
Instance Method Summary collapse
-
#initialize(expected, got) ⇒ UnexpectedTokenError
constructor
A new instance of UnexpectedTokenError.
- #message ⇒ Object
Constructor Details
#initialize(expected, got) ⇒ UnexpectedTokenError
Returns a new instance of UnexpectedTokenError.
7 8 9 10 |
# File 'lib/component_embedded_ruby/unexpected_token_error.rb', line 7 def initialize(expected, got) @expected = expected @got = got end |
Instance Attribute Details
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
5 6 7 |
# File 'lib/component_embedded_ruby/unexpected_token_error.rb', line 5 def expected @expected end |
#got ⇒ Object (readonly)
Returns the value of attribute got.
5 6 7 |
# File 'lib/component_embedded_ruby/unexpected_token_error.rb', line 5 def got @got end |
Instance Method Details
#message ⇒ Object
12 13 14 15 16 17 |
# File 'lib/component_embedded_ruby/unexpected_token_error.rb', line 12 def <<~MESSAGE.strip Unexpected token at line #{got.position.line}, column #{got.position.column} Got `#{got.value}`#{} MESSAGE end |