class CBOR::Encoder

Defined in:

cbor/encoder.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

to_cbor(io : IO)
to_cbor(encoder : CBOR::Encoder)
to_cbor : Bytes
to_cbor

Class methods inherited from class Object

from_cbor(string_or_io) from_cbor

Constructor Detail

def self.new(io : IO = IO::Memory.new, &) #

[View source]
def self.new(io : IO = IO::Memory.new) #

[View source]

Instance Method Detail

def object(&) #

[View source]
def to_s : String #
Description copied from class Object

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.


[View source]
def to_slice : Bytes #

[View source]
def write(value : Nil | Nil.class, use_undefined : Bool = false) #

[View source]
def write(value : Bool) #

[View source]
def write(value : String) #

[View source]
def write(value : Bytes) #

[View source]
def write(value : Symbol) #

[View source]
def write(value : Float32 | Float64) #

[View source]
def write(value : Int8 | Int16 | Int32 | Int64) #

[View source]
def write(value : Int128) #

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


[View source]
def write(value : UInt8 | UInt16 | UInt32 | UInt64, offset : UInt8 = 0) #

[View source]
def write(value : Hash) #

[View source]
def write(value : Array) #

[View source]
def write(value : Tuple) #

[View source]
def write(value : SimpleValue) #

[View source]
def write(tag : Tag) #

[View source]
def write_array_start(size) #

[View source]
def write_object_start(size) #

[View source]