Why is that? It seems unexpected.

class A
  def initialize(a)
    @foo = a
  end

  def sort_key
    -@foo
  end

  def inspect
    @foo.to_s
  end

  private :sort_key
end

b = [1,2,3,4,5].map {|x| A.new(x)}

p b
p b.sort_by(&:sort_key) # works
p b.sort_by {|x| x.sort_key} # private method called error

martin