Class: NBTFile::Private::Tokenizer
- Inherits:
-
Object
- Object
- NBTFile::Private::Tokenizer
- Defined in:
- lib/nbtfile.rb
Instance Method Summary collapse
- #each_token ⇒ Object
- #get_token ⇒ Object
-
#initialize(io) ⇒ Tokenizer
constructor
A new instance of Tokenizer.
Constructor Details
#initialize(io) ⇒ Tokenizer
Returns a new instance of Tokenizer.
302 303 304 305 |
# File 'lib/nbtfile.rb', line 302 def initialize(io) @gz = Zlib::GzipReader.new(io) @state = TopTokenizerState.new() end |
Instance Method Details
#each_token ⇒ Object
307 308 309 310 311 |
# File 'lib/nbtfile.rb', line 307 def each_token while token = get_token() yield token end end |
#get_token ⇒ Object
313 314 315 316 |
# File 'lib/nbtfile.rb', line 313 def get_token @state, token = @state.get_token(@gz) token end |