Replace .to_h for pre-2.1 rubby