Module: ActionFigure::Formatter
- Includes:
- ErrorRegistry::Helpers
- Included in:
- ActionFigure::Formatters::Default, ActionFigure::Formatters::Jsend, ActionFigure::Formatters::JsonApi, ActionFigure::Formatters::Rfc9457, ActionFigure::Formatters::Wrapped
- Defined in:
- lib/action_figure/formatter.rb,
sig/action_figure.rbs
Overview
Base module for response formatters
Constant Summary collapse
- REQUIRED_METHODS =
Structural methods every formatter must define: the three success helpers plus the single error_response. Named error helpers are generated from ActionFigure.error_statuses onto ErrorRegistry::Helpers (included here), so they are NOT a per-formatter obligation.
%i[Ok Created Accepted error_response].freeze
Instance Method Summary collapse
Methods included from ErrorRegistry::Helpers
#Conflict, #Forbidden, #Gone, #Locked, #NotFound, #PaymentRequired, #UnavailableForLegalReasons, #UnprocessableContent
Instance Method Details
#NoContent ⇒ ActionFigure::response
19 20 21 |
# File 'lib/action_figure/formatter.rb', line 19 def NoContent { status: :no_content } end |