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 (sdk-ruby-plan.md §3.1).

client.documents namespace (sdk-ruby-plan.md §13 Phase 4, port of sdk-node/src/documents.ts).

Convenience value-object form of the project-mode render input. 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 inline-mode render input. Inline mode is only accepted by client.render.preview (sdk-ruby-plan.md §13 Phase 2); the render-to-document methods require project mode.

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.

Return value of client.render.preview. The HTML is the rendered output; total_pages is the page count the rendering engine reports; environment is either "sandbox" or "live" and reflects the key the request was made with.

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. Distinct from PoliPage::PreviewResult: this carries page_count (NOT total_pages) because the documents.preview endpoint exposes the page count via the X-Document-Page-Count response header on a text/html body (sdk-ruby-plan.md §13 Phase 4; 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 set is used both for input validation (in resource methods) and for documentation.

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

Event payload for the on_retry constructor hook (sdk-ruby-plan.md §10.2).

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