Class: UniversalRenderer::SSR::Response

Inherits:
Struct
  • Object
show all
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

Instance Attribute Details

#bodyString?

Returns Raw body HTML snippet produced by the renderer.

Returns:

  • (String, nil)

    Raw body HTML snippet produced by the renderer.



17
# File 'lib/universal_renderer/ssr/response.rb', line 17

Response = Struct.new(:head, :body, :body_attrs, keyword_init: true)

#body_attrsHash?

Returns A hash of attributes that should be applied to the tag.

Returns:

  • (Hash, nil)

    A hash of attributes that should be applied to the tag.



17
# File 'lib/universal_renderer/ssr/response.rb', line 17

Response = Struct.new(:head, :body, :body_attrs, keyword_init: true)

#headString?

Returns Raw HTML snippet produced by the renderer.

Returns:

  • (String, nil)

    Raw HTML snippet produced by the renderer.



17
# File 'lib/universal_renderer/ssr/response.rb', line 17

Response = Struct.new(:head, :body, :body_attrs, keyword_init: true)