lib/quirky-api/response/response_adapter.rb
# finalize! is called after the response data has been manipulated,
# before we actually call +render json: ...+ on it.  This method calls
# the +finalize+ method on any adapter that has it (as determined above),
# which in turn allows you to change things like response status, JSONP
# callbacks, and so forth.
#
# Note: Your custom +finalize+ implementation must accept the
# +renderable+ argument and return a Ruby Hash that the +render+ method
# can understand.
#
# @param [Hash] The current object that will be called by +render+ when
#               all is said and done.
#
finalize. is called after the response data has been manipulated,
before we actually call +render json: ...+ on it.  This method calls
the +finalize+ method on any adapter that has it (as determined above),
which in turn allows you to change things like response status, JSONP
callbacks, and so forth.


finalize . is called after the response data has been manipulated before we actually call + render json : ... + on it . This method calls the + finalize + method on any adapter that has it ( as determined above ) which in turn allows you to change things like response status JSONP callbacks and so forth .
def finalize!(renderable)
        @_finalize_adapters.each do |adapter|
          a = adapter.new(data, options)
          renderable = a.finalize(renderable)
        end
        renderable
      end
def finalize! ( renderable ) @_finalize_adapters . each do | adapter | a = adapter . new ( data , options ) renderable = a . finalize ( renderable ) end renderable end
finalize!
finalize!
# As determined above, get all adapters that implement a +finalize+ # method and iterate over those adapters. # Instantiate a new instance.  We do this to ensure that we # definitely have the latest data / options following data # manipulation by the +call!+ method. # Call +finalize+ on the adapter and set +renderable+ to its # response. # Return the very final response object.  Just after this is called, # we call +render+ with this value.
renderable
The current object that will be called by +render+ when all is said and done.
The current object that will be called by + render + when all is said and done .