Class: UniversalRenderer::SSR::Response
- Inherits:
-
Struct
- Object
- Struct
- UniversalRenderer::SSR::Response
- Defined in:
- lib/universal_renderer/ssr/response.rb
Overview
Lightweight value object representing the payload returned by the
Node.js SSR service. Using a Struct keeps the data immutable-ish while
still allowing hash-like access (e.g. response[:head]).
The contract between the Ruby Gem and the Node service guarantees that
at minimum the head and body keys are present. Additional keys are
accepted but ignored (see Client::Base).
Instance Attribute Summary collapse
-
#body ⇒ String?
Raw body HTML snippet produced by the renderer.
-
#body_attrs ⇒ Hash?
A hash of attributes that should be applied to the
tag. -
#head ⇒ String?
Raw
HTML snippet produced by the renderer. -
#payload ⇒ Object?
Arbitrary JSON-serializable hydration state the renderer produced, such as a dehydrated query cache.
Instance Attribute Details
#body ⇒ String?
Returns Raw body HTML snippet produced by the renderer.
21 22 |
# File 'lib/universal_renderer/ssr/response.rb', line 21 Response = Struct.new(:head, :body, :body_attrs, :payload, keyword_init: true) |
#body_attrs ⇒ Hash?
Returns A hash of attributes that should be applied to the
tag.
21 22 |
# File 'lib/universal_renderer/ssr/response.rb', line 21 Response = Struct.new(:head, :body, :body_attrs, :payload, keyword_init: true) |
#head ⇒ String?
Returns Raw
HTML snippet produced by the renderer.
21 22 |
# File 'lib/universal_renderer/ssr/response.rb', line 21 Response = Struct.new(:head, :body, :body_attrs, :payload, keyword_init: true) |
#payload ⇒ Object?
Returns Arbitrary JSON-serializable hydration state the
renderer produced, such as a dehydrated query cache. Emit it with the
ssr_payload helper.
21 22 |
# File 'lib/universal_renderer/ssr/response.rb', line 21 Response = Struct.new(:head, :body, :body_attrs, :payload, keyword_init: true) |