lib/sinatra/base.rb
# Returns an array of acceptable media types for the response
Returns an array of acceptable media types for the response
Returns an array of acceptable media types for the response
def preferred_type(*types)
      return accept.first if types.empty?
      types.flatten!
      accept.detect do |pattern|
        type = types.detect { |t| File.fnmatch(pattern, t) }
        return type if type
      end
    end
def preferred_type ( * types ) return accept . first if types . empty? types . flatten! accept . detect do | pattern | type = types . detect { | t | File . fnmatch ( pattern , t ) } return type if type end end
Returns an array of acceptable media types for the response
Returns an array of acceptable media types for the response
types