Class: Dhaka::TokenizerErrorResult

Inherits:
Object
  • Object
show all
Defined in:
lib/tokenizer/tokenizer.rb

Overview

Returned when tokenizing fails due to an unexpected character in the input stream.

Instance Attribute Summary collapse

Instance Method Summary collapse

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_indexObject (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.

Returns:

  • (Boolean)


32
33
34
# File 'lib/tokenizer/tokenizer.rb', line 32

def has_error?
  true
end