Implement generator for #sort_by