class

CBOR::Encoder

Inherits Reference / Object

Constructors

new(io : IO = IO::Memory.new, &)
Source
new(io : IO = IO::Memory.new)
Source

Instance methods

object
Source
to_s

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.

Source
to_slice
Source
write(value : Nil | Nil.class, use_undefined : Bool = false)
Source
write(value : Bool)
Source
write(value : String)
Source
write(value : Bytes)
Source
write(value : Symbol)
Source
write(value : Float32 | Float64)
Source
write(value : Int8 | Int16 | Int32 | Int64)
Source
write(value : Int128)

The Int128 can't be bigger than an UInt64 if positive or when inverted

Source
write(value : UInt8 | UInt16 | UInt32 | UInt64, offset : UInt8 = 0)
Source
write(value : Hash)
Source
write(value : Array)
Source
write(value : Tuple)
Source
write(value : SimpleValue)
Source
write(tag : Tag)
Source
write_array_start(size)
Source
write_object_start(size)
Source