Class: Aws::Cbor::Decoder Private
- Inherits:
- 
      Object
      
        - Object
- Aws::Cbor::Decoder
 
- Defined in:
- lib/aws-sdk-core/cbor/decoder.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Pure Ruby implementation of CBOR Decoder
Instance Method Summary collapse
- #decode ⇒ Object private
- 
  
    
      #initialize(bytes)  ⇒ Decoder 
    
    
  
  
  
    constructor
  
  
  
  
  
  private
  
    A new instance of Decoder. 
Constructor Details
#initialize(bytes) ⇒ Decoder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Decoder.
| 7 8 9 10 | # File 'lib/aws-sdk-core/cbor/decoder.rb', line 7 def initialize(bytes) @buffer = bytes @pos = 0 end | 
Instance Method Details
#decode ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
| 12 13 14 15 16 17 18 19 | # File 'lib/aws-sdk-core/cbor/decoder.rb', line 12 def decode return nil if @buffer.nil? || @buffer.empty? val = decode_item return val unless @pos != @buffer.size raise ExtraBytesError.new(@pos, @buffer.size) end |