Types
The Ruby SDK exposes the public classes, value objects, and resource namespaces below. They live under the PoliPage module:
require "poli_page"PoliPage::Client
Section titled “PoliPage::Client”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.
PoliPage::Resources::Render
Section titled “PoliPage::Resources::Render”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).
PoliPage::Resources::Documents
Section titled “PoliPage::Resources::Documents”client.documents namespace (sdk-ruby-plan.md §13 Phase 4, port of
sdk-node/src/documents.ts).
PoliPage::ProjectModeInput
Section titled “PoliPage::ProjectModeInput”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.
PoliPage::InlineModeInput
Section titled “PoliPage::InlineModeInput”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.
PoliPage::ThumbnailOptions
Section titled “PoliPage::ThumbnailOptions”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.
PoliPage::PreviewResult
Section titled “PoliPage::PreviewResult”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.
PoliPage::DocumentDescriptor
Section titled “PoliPage::DocumentDescriptor”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.
PoliPage::DocumentPreviewResult
Section titled “PoliPage::DocumentPreviewResult”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).
PoliPage::Thumbnail
Section titled “PoliPage::Thumbnail”A single page thumbnail returned by client.documents.thumbnails.
data is base64-encoded image bytes; decode with Base64.decode64(data)
(stdlib).
PoliPage::PageFormat
Section titled “PoliPage::PageFormat”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.
PoliPage::Orientation
Section titled “PoliPage::Orientation”Valid orientation: strings for the rendering endpoints
(sdk-specification.md §4.1).
PoliPage::RetryEvent
Section titled “PoliPage::RetryEvent”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.