A class of torsion-free abelian groups characterized by the ranks of their socles