我在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