Ruby - fix enumeration for json objects