Module: Deimos::Utils::SchemaControllerMixin

Extended by:
ActiveSupport::Concern
Defined in:
sig/defs.rbs

Overview

Mixin to automatically decode schema-encoded payloads when given the correct content type, and provide the render_schema method to encode the payload for responses.

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#decode_schemavoid

This method returns an undefined value.

Decode the payload with the parameters.



1163
# File 'sig/defs.rbs', line 1163

def decode_schema: () -> void

#parse_namespace::Array[(String | String)]

Get the namespace from either an existing instance variable, or tease it out of the schema.

@param type — :request or :response

@return — the namespace and schema.

Parameters:

  • _type (Symbol)

Returns:

  • (::Array[(String | String)])


1160
# File 'sig/defs.rbs', line 1160

def parse_namespace: (Symbol _type) -> ::Array[(String | String)]

#render_schemavoid

This method returns an undefined value.

Render a hash into a payload as specified by the configured schema and namespace.

@param payload

@param schema

@param namespace

Parameters:

  • payload (::Hash[untyped, untyped])
  • schema: (String, nil)
  • namespace: (String, nil)


1172
# File 'sig/defs.rbs', line 1172

def render_schema: (::Hash[untyped, untyped] payload, ?schema: String?, ?namespace: String?) -> void

#schema_format?Boolean

Returns:

  • (Boolean)


1153
# File 'sig/defs.rbs', line 1153

def schema_format?: () -> bool