Class: Apiwork::Adapter::Wrapper::Member::Base
- Defined in:
- lib/apiwork/adapter/wrapper/member/base.rb
Overview
Base class for member response wrappers.
Member wrappers structure responses for show, create, and update actions that return a single record. Extend this class to customize how individual resources are wrapped in your API responses.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#meta ⇒ Hash
readonly
The meta for this wrapper.
-
#metadata ⇒ Hash
readonly
The metadata for this wrapper.
- #root_key ⇒ Object readonly
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(data, metadata, root_key, meta) ⇒ Base
constructor
A new instance of Base.
Methods inherited from Base
Constructor Details
#initialize(data, metadata, root_key, meta) ⇒ Base
Returns a new instance of Base.
48 49 50 51 52 53 |
# File 'lib/apiwork/adapter/wrapper/member/base.rb', line 48 def initialize(data, , root_key, ) super(data) @metadata = @root_key = root_key @meta = end |
Instance Attribute Details
#meta ⇒ Hash (readonly)
The meta for this wrapper.
44 45 46 |
# File 'lib/apiwork/adapter/wrapper/member/base.rb', line 44 def @meta end |
#metadata ⇒ Hash (readonly)
The metadata for this wrapper.
44 45 46 |
# File 'lib/apiwork/adapter/wrapper/member/base.rb', line 44 attr_reader :meta, :metadata, :root_key |
#root_key ⇒ Object (readonly)
44 45 46 |
# File 'lib/apiwork/adapter/wrapper/member/base.rb', line 44 attr_reader :meta, :metadata, :root_key |