Class: MiniApi::RelationResponder
- Inherits:
-
Object
- Object
- MiniApi::RelationResponder
- Includes:
- Serialization
- Defined in:
- lib/mini_api/relation_responder.rb
Instance Method Summary collapse
-
#initialize(controller, resource, options = {}) ⇒ RelationResponder
constructor
A new instance of RelationResponder.
- #respond ⇒ Object
Methods included from Serialization
#get_error_serializer, #serialiable_body
Constructor Details
#initialize(controller, resource, options = {}) ⇒ RelationResponder
Returns a new instance of RelationResponder.
11 12 13 14 15 |
# File 'lib/mini_api/relation_responder.rb', line 11 def initialize(controller, resource, = {}) @controller = controller @resource = resource = end |
Instance Method Details
#respond ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/mini_api/relation_responder.rb', line 17 def respond , collection = = CaseTransform.response_keys() collection = transform_case(collection.as_json) @controller.render json: { success: [:success] || true, data: collection, meta: }, status: [:status] end |