Method: Cborb::Decoding::State#initialize

Defined in:
lib/cborb/decoding/state.rb

#initializeState

Returns a new instance of State.



7
8
9
10
11
12
13
14
15
16
# File 'lib/cborb/decoding/state.rb', line 7

def initialize
  @buffer = Cborb::Decoding::SimpleBuffer.new
  @stack = [[Cborb::Decoding::Types::Root, nil]]
  @result = NO_RESULT

  # This fiber decodes CBOR.
  # If buffer becomes empty, this fiber is stopped(#consume)
  # When new CBOR data is buffered(#<<), that is resumed.
  @decoding_fiber = Fiber.new { loop_consuming }
end