Class: Dhaka::TokenizerSuccessResult

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

Overview

Returned on successful tokenizing of the input stream. Supports iteration by including Enumerable, so it can be passed in directly to the parser.

Instance Method Summary collapse

Constructor Details

#initialize(tokens) ⇒ TokenizerSuccessResult

Returns a new instance of TokenizerSuccessResult.



10
11
12
# File 'lib/dhaka/tokenizer/tokenizer.rb', line 10

def initialize(tokens)
  @tokens = tokens
end

Instance Method Details

#each(&block) ⇒ Object



19
20
21
# File 'lib/dhaka/tokenizer/tokenizer.rb', line 19

def each(&block)
  @tokens.each(&block)
end

#has_error?Boolean

Returns false.

Returns:

  • (Boolean)


15
16
17
# File 'lib/dhaka/tokenizer/tokenizer.rb', line 15

def has_error?
  false
end