Skip to content

Types

The Ruby SDK exposes the public classes, value objects, and resource namespaces below. They live under the PoliPage module:

require "poli_page"

Main entry point — orchestrates retries, fires hooks, and delegates HTTP execution to PoliPage::Internal::Transport. The render and documents resource namespaces hold a reference to this client and delegate request execution back through it.

client.render namespace. Each method captures a back-reference to the parent PoliPage::Client and delegates HTTP execution through it.

client.documents namespace (port of sdk-node/src/documents.ts).

Convenience value-object form of the render input, the only input of client.render.document, #pdf and #pdf_stream: a published project addressed by slug. Methods accept bare kwargs directly; this wrapper is for callers who want Data.define’s equality, frozen-by-default semantics, and a single marshallable type to thread through their own code.

Convenience value-object form of the client.documents.thumbnails options hash. Methods accept bare kwargs directly; this wrapper is for callers who want Data.define’s equality + frozen-by-default semantics.

The stored-document descriptor returned by client.render.document and the client.documents.* methods. Carries every wire field plus an SDK-attached _client back-reference used by #download_pdf.

Return value of client.documents.preview: the stored HTML of an already rendered document, with page_count read from the X-Document-Page-Count response header on a text/html body (mirrors Node documents.ts:75-77).

A single page thumbnail returned by client.documents.thumbnails. data is base64-encoded image bytes; decode with Base64.decode64(data) (stdlib).

Valid format: strings for the rendering endpoints (sdk-specification.md §4.1). Ruby has no native enum; a frozen Set of strings is the most idiomatic representation and matches the wire format directly. The SDK does not check format: against it before a request (the API answers an unknown value with 400 VALIDATION_ERROR); valid? is there for callers who want to check their own input.

Valid orientation: strings for the rendering endpoints (sdk-specification.md §4.1).

Event payload for the on_retry constructor hook.

For value-object internals (Data.define’d objects like PoliPage::DocumentDescriptor), see the source on GitHub.