我在Ruby中有這樣的代碼有可能把它寫得更短嗎?Ruby數組優化代碼
first_name = person[0]
last_name = person[1]
person_id = person[2]
email = person[3]
title = person[4]
phone = person[5]
mobile = person[6]
department = person[7]
address = person[8]
city = person[9]
zip_code =person[10]
state =person[11]
country = person[12]
manager_id = person[13]
這看起來像'person'應該開始用哈希。 –
或者,你知道,一個'人'。 –
這個問題似乎是脫離主題,因爲它是關於http://codereview.stackexchange.com – MikDiet