Default
Default collection response wrapper.
Wraps serialized records under a pluralized root key with optional meta and capability metadata.
Example: Configuration
ruby
class MyAdapter < Adapter::Base
collection_wrapper Wrapper::Collection::Default
endExample: Output
ruby
{
"invoices": [
{ "id": 1, "number": "INV-001" },
{ "id": 2, "number": "INV-002" }
],
"meta": { ... },
"pagination": { "current": 1, "total": 5 }
}Class Methods
.shape
.shape(klass_or_callable = nil, &block)
Defines the response shape for contract generation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
klass_or_callable | Class<Shape>, Proc, nil | nil | A Shape subclass or callable. |
Returns
Class<Shape>, nil
Instance Methods
#data
#data
The data for this wrapper.
Returns
Hash
#meta
#meta
The meta for this wrapper.
Returns
Hash
#metadata
#metadata
The metadata for this wrapper.
Returns
Hash