writing/creating javascript object properties and indexing from ruby