forked from rubygarage/boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Macro::Renderer
Vladislav Trotsenko edited this page Oct 21, 2020
·
1 revision
Provides to render operation result with specified serializer with strict following Jsonapi specification. That means that macros aggregate :inclusion_options and :links from context too.
class SomeOperation < ApplicationOperation
step Macro::Renderer()
endclass SomeOperation < ApplicationOperation
step Macro::Renderer(serializer: SomeSerializer)
endValue for :meta is reference to ctx[key] => meta: :some_meta_data is equal to meta: ctx[:some_meta_data]
class SomeOperation < ApplicationOperation
step Macro::Assign(to: :some_meta_data, value: {})
step Macro::Renderer(serializer: SomeSerializer, meta: :some_meta_data)
end