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
-
#decode_schema ⇒ void
Decode the payload with the parameters.
-
#parse_namespace ⇒ ::Array[(String | String)]
Get the namespace from either an existing instance variable, or tease it out of the schema.
-
#render_schema ⇒ void
Render a hash into a payload as specified by the configured schema and namespace.
- #schema_format? ⇒ Boolean
Instance Method Details
#decode_schema ⇒ void
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.
1160 |
# File 'sig/defs.rbs', line 1160
def parse_namespace: (Symbol _type) -> ::Array[(String | String)]
|
#render_schema ⇒ void
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
1172 |
# File 'sig/defs.rbs', line 1172
def render_schema: (::Hash[untyped, untyped] payload, ?schema: String?, ?namespace: String?) -> void
|
#schema_format? ⇒ Boolean
1153 |
# File 'sig/defs.rbs', line 1153
def schema_format?: () -> bool
|