Change ruby to split key into type and key