From: dan donaldson Date: 2006-06-20T04:51:22+09:00 Subject: associative array naming indirection I have an array of names in string form as an instance var. The class the array is in has a method that takes an array of string values. I want to construct an associative array such that the names in the first array are the keys to the values in the received array. this throws an error: -------------- def initialize @labels = ['prov', 'area', 'zone', district', 'postalcode', 'city_prov', 'addr'] @pageData = {} end def adddata(data) max = data.length max -= 1 0.upto(max) {|i| @pageData[@labels[i]] => data[i] } end -------------- obviously, some giant conceptual leap needs to be made, or its a miniscule typo. (methinks the former) Anyone got advice? -- Posted via http://www.ruby-forum.com/.