# File lib/cgikit/displaygroup.rb, line 177
    def sorter_from_sort_keys
      proc do |a, b|
        if a.nil? and b.nil? then
          break 0
        elsif a.nil? then
          break -1
        elsif b.nil? then
          break 1
        end

        hash1 = Hash === a
        hash2 = Hash === b

        @sort_keys.each do |sort|
          if hash1 then
            a = a[sort.key]
          else
            a = a.__send__(sort.key)
          end
          if hash2 then
            b = b[sort.key]
          else
            b = b.__send__(sort.key)
          end

          if a.nil? and b.nil? then
            break 0
          elsif a.nil? then
            break -1
          elsif b.nil? then
            break 1
          else
            if a.__send__(sort.method, b) then
              break 1
            else
              break -1
            end
          end
        end
      end
    end