Module: JSONAPI::Callbacks::ClassMethods
- Defined in:
- lib/jsonapi/callbacks.rb
Instance Method Summary collapse
Instance Method Details
#define_jsonapi_resources_callbacks(*callbacks) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/jsonapi/callbacks.rb', line 13 def define_jsonapi_resources_callbacks(*callbacks) = callbacks. = { only: [:before, :around, :after] }.merge!() types = Array(.delete(:only)) callbacks.each do |callback| define_callbacks(callback, ) types.each do |type| send("_define_#{type}_callback", self, callback) end end end |