def eligable_matches
      @_eligable_matches ||= begin
        matches.select { |m| m.failed_condition.nil? }.each_with_index.sort_by do |m,idx|
          priority = m.mapping[:priority] || 0
          media_type_rank = [*m.mapping[:conditions][:media_type]].map { |type|
            env['scorched.accept'][:accept].rank(type, true)
          }.max || 0
          order = -idx
          [priority, media_type_rank, order]
        end.reverse
      end
    end
def eligable_matches
      @_eligable_matches ||= begin
        matches.select { |m| m.failed_condition.nil? }.each_with_index.sort_by do |m,idx|
          priority = m.mapping[:priority] || 0
          media_type_rank = [*m.mapping[:conditions][:media_type]].map { |type|
            env['scorched.accept'][:accept].rank(type, true)
          }.max || 0
          order = -idx
          [priority, media_type_rank, order]
        end.reverse
      end
    end
Returns an ordered list of eligable matches.
 Orders matches based on media_type, ensuring priority and definition order are respected appropriately.
 Sorts by mapping priority first, media type appropriateness second, and definition order third.