Method: Middlewares::Decorator::Representable.perform

Defined in:
lib/endpoint_flux/tasks/endpoint_flux/generators/endpoint_flux/middlewares/decorator/representable.rb

.perform(request, response, options) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/endpoint_flux/tasks/endpoint_flux/generators/endpoint_flux/middlewares/decorator/representable.rb', line 4

def self.perform(request, response, options)
  resource_name = options[:wrapped_in] || options[:decorator]
  resource      = response.body[resource_name]

  response.body[resource_name] = decorate(resource, options) if resource

  [request, response]
end