Class: Dhaka::TokenizerSuccessResult
- Inherits:
-
Object
- Object
- Dhaka::TokenizerSuccessResult
- Includes:
- Enumerable
- Defined in:
- lib/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 ⇒ 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/tokenizer/tokenizer.rb', line 10 def initialize(tokens) @tokens = tokens end |
Instance Method Details
#each ⇒ Object
17 18 19 20 21 |
# File 'lib/tokenizer/tokenizer.rb', line 17 def each @tokens.each do |token| yield token end end |
#has_error? ⇒ Boolean
Returns false.
14 15 16 |
# File 'lib/tokenizer/tokenizer.rb', line 14 def has_error? false end |