Class: NBTFile::CompoundWriterState
- Inherits:
-
Object
- Object
- NBTFile::CompoundWriterState
- Includes:
- Tokens, WriteMethods
- Defined in:
- lib/nbtfile.rb
Instance Method Summary collapse
- #emit_item(io, value) ⇒ Object
- #emit_token(io, token) ⇒ Object
-
#initialize(cont, capturing) ⇒ CompoundWriterState
constructor
A new instance of CompoundWriterState.
Methods included from WriteMethods
#emit_byte, #emit_byte_array, #emit_double, #emit_float, #emit_int, #emit_integer, #emit_list_header, #emit_long, #emit_short, #emit_string, #emit_type, #emit_value
Methods included from CommonMethods
Constructor Details
#initialize(cont, capturing) ⇒ CompoundWriterState
Returns a new instance of CompoundWriterState.
408 409 410 411 |
# File 'lib/nbtfile.rb', line 408 def initialize(cont, capturing) @cont = cont @capturing = capturing end |
Instance Method Details
#emit_item(io, value) ⇒ Object
424 425 426 |
# File 'lib/nbtfile.rb', line 424 def emit_item(io, value) raise RuntimeError, "not in a list" end |
#emit_token(io, token) ⇒ Object
413 414 415 416 417 418 419 420 421 422 |
# File 'lib/nbtfile.rb', line 413 def emit_token(io, token) out = @capturing || io type = token.class emit_type(out, type) emit_string(out, token.name) unless type == TAG_End emit_value(out, type, token.value, @capturing, self, @cont) end |