def metadata_for(object, options, type, singular)
      {}.tap do |metadata|
        metadata[:count]      = object.length unless singular
        metadata[:pagination] = Respondable.extract_pagination(object) if type == :paginated
        metadata.merge! options[:metadata] if options[:metadata]
      end
    end
def metadata_for(object, options, type, singular)
      {}.tap do |metadata|
        metadata[:count]      = object.length unless singular
        metadata[:pagination] = Respondable.extract_pagination(object) if type == :paginated
        metadata.merge! options[:metadata] if options[:metadata]
      end
    end
Extracts the metadata for the current response, merging in options etc.
 Implements a simple hook to allow adding extra metadata to your api.

 @param [Object] object the data being exposed
 @param [Hash{Symbol => Object}] options expose options optionally including new metadata.
 @param [Symbol] type the type of the current object
 @param [true,false] singular true iff the current object is a singular resource