Class: Dhaka::TokenizerSuccessResult
- Inherits:
-
Object
- Object
- Dhaka::TokenizerSuccessResult
- 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
- #each(&block) ⇒ Object
-
#has_error? ⇒ Boolean
Returns false.
-
#initialize(tokens) ⇒ TokenizerSuccessResult
constructor
A new instance of TokenizerSuccessResult.
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.
15 16 17 |
# File 'lib/dhaka/tokenizer/tokenizer.rb', line 15 def has_error? false end |