Class: Cborb::Decoding::Decoder

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/cborb/decoding/decoder.rb

Instance Method Summary collapse

Constructor Details

#initializeDecoder

Returns a new instance of Decoder.



7
8
9
# File 'lib/cborb/decoding/decoder.rb', line 7

def initialize
  @state = Cborb::Decoding::State.new
end

Instance Method Details

#decode(cbor) ⇒ Object



11
12
13
# File 'lib/cborb/decoding/decoder.rb', line 11

def decode(cbor)
  @state << cbor.to_s
end

#inspectObject



15
16
17
# File 'lib/cborb/decoding/decoder.rb', line 15

def inspect
  "#<#{self.class}:#{object_id} finished=#{finished?} result=#{finished? ? result : "nil"}>"
end