abstract class Movie::Remote::JsonPayload

Overview

A JSON value that can write itself directly to a builder.

Outbound payloads retain the original serializable value instead of materializing a String and parsing it into a JSON DOM. Connection-owned decoders retain registered payloads as typed wrappers; unknown and payload-before-type envelopes retain raw JSON. Both forms build JSON::Any only for dynamic access.

Direct Known Subclasses

Defined in:

movie/remote/json_payload.cr

Constructors

Instance Method Summary

Constructor Detail

def self.wrap(payload : JsonPayload) : JsonPayload #

[View source]
def self.wrap(payload : JSON::Any) : JsonPayload #

[View source]
def self.wrap(payload : T) : JsonPayload forall T #

[View source]

Instance Method Detail

def [](key : String) : JSON::Any #

[View source]
def []?(key : String) : JSON::Any | Nil #

[View source]
abstract def json_source : String | IO #

[View source]
def to_any : JSON::Any #

[View source]
abstract def to_json(json : JSON::Builder) : Nil #

[View source]