Module: CBOR::FloatHelper
- Defined in:
- lib/libcbor/helpers.rb
Overview
Provides the #to_cbor (or equivalent) method for Floats
Instance Method Summary collapse
-
#__libcbor_to_cbor ⇒ String
Encodes Floatss.
Instance Method Details
#__libcbor_to_cbor ⇒ String
Encodes Floatss. Width and precision are handled automatically
22 23 24 25 |
# File 'lib/libcbor/helpers.rb', line 22 def __libcbor_to_cbor @@bfr ||= FFI::Buffer.new(:uchar, 9) @@bfr.get_bytes(0, LibCBOR.cbor_encode_single(self, @@bfr, 9)) end |