C0::Builder
Builds C0DATA documents in compact form.
Example: buf = C0::Builder.build do |b| b.file("mydb") do b.group("users", headers: ["name", "amount", "type"]) do b.record("Alice", "1502.30", "DEPOSIT") b.record("Bob", "340.00", "WITHDRAWAL") end end end
Constructors
Class methods
Instance methods
Write an ETB commit marker (stream mode), with an optional integrity payload. The payload may not contain control bytes — it is terminated by the next control code on read.
Write a raw field value (for use within records when building fields individually).
Write a group/table scope with optional headers.
Write a group/table scope (no block).
Write a standalone SOH header (e.g. for stream mode, where the header is appended and committed separately from the group).
Write a field whose value is a flat list (spec: "arrays are
US-separated values inside STX/ETX"): US, STX, the items separated
by US, ETX. Read back with Record#list.
Write a reference to a named group. Reference targets are names,
so control bytes are rejected (see write_name).
Write a path reference (group, record id, optional field). Each segment is a name, so control bytes are rejected.
Write GS×N for document-mode depth (no block).