module HTTP::Accept::Sort
Public Class Methods
Source
# File lib/http/accept/sort.rb, line 27 def self.by_quality_factor(items) # We do this to get a stable sort: items.sort_by.with_index{|object, index| [-object.quality_factor, index]} end
This sorts items with higher priority first, and keeps items with the same priority in the same relative order.