Woman can keep engagement ring, judge rules