Module: Aws::RpcV2::CborEngine Private

Defined in:
lib/aws-sdk-core/rpc_v2/cbor_engine.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Pure Ruby implementation of CBOR encode and decode

Class Method Summary collapse

Class Method Details

.decode(bytes) ⇒ 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.



13
14
15
# File 'lib/aws-sdk-core/rpc_v2/cbor_engine.rb', line 13

def self.decode(bytes)
  Cbor::Decoder.new(bytes.force_encoding(Encoding::BINARY)).decode
end

.encode(data) ⇒ 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.



9
10
11
# File 'lib/aws-sdk-core/rpc_v2/cbor_engine.rb', line 9

def self.encode(data)
  Cbor::Encoder.new.add(data).bytes
end