Class: Dhaka::TokenizerErrorResult
- Inherits:
-
Object
- Object
- Dhaka::TokenizerErrorResult
- Defined in:
- lib/tokenizer/tokenizer.rb
Overview
Returned when tokenizing fails due to an unexpected character in the input stream.
Instance Attribute Summary collapse
-
#unexpected_char_index ⇒ Object
readonly
The index of the character that caused the error.
Instance Method Summary collapse
-
#has_error? ⇒ Boolean
Returns true.
-
#initialize(unexpected_char_index) ⇒ TokenizerErrorResult
constructor
A new instance of TokenizerErrorResult.
Constructor Details
#initialize(unexpected_char_index) ⇒ TokenizerErrorResult
Returns a new instance of TokenizerErrorResult.
28 29 30 |
# File 'lib/tokenizer/tokenizer.rb', line 28 def initialize(unexpected_char_index) @unexpected_char_index = unexpected_char_index end |
Instance Attribute Details
#unexpected_char_index ⇒ Object (readonly)
The index of the character that caused the error.
27 28 29 |
# File 'lib/tokenizer/tokenizer.rb', line 27 def unexpected_char_index @unexpected_char_index end |
Instance Method Details
#has_error? ⇒ Boolean
Returns true.
32 33 34 |
# File 'lib/tokenizer/tokenizer.rb', line 32 def has_error? true end |