Module: CBOR::TagHelper

Defined in:
lib/libcbor/helpers.rb

Overview

Provides the #to_cbor (or equivalent) method for Tags

Instance Method Summary collapse

Instance Method Details

#__libcbor_to_cborString

Encodes Tags.

The CBOR::Tag#item is encoded recursively using the to_cbor method or its equivalent

Returns:

  • (String)

    The CBOR representation



109
110
111
112
113
# File 'lib/libcbor/helpers.rb', line 109

def __libcbor_to_cbor
	@@bfr ||= FFI::Buffer.new(:uchar, 9)
	header = @@bfr.get_bytes(0, LibCBOR.cbor_encode_tag(value, @@bfr, 9))
	header + item.public_send(CBOR.method_name)
end