我得到我的json响应并解析它,我能够分别获取以下模型和标识符(请参阅下文)。 现在,我只需要按照模型对它们进行排序,不区分大小写。所以,如果我创建一个数组,那么即使不是不可能,也很难按照模型进行排序,如果我做了散列,我将无法创建重复的键(模型)。
那么排序这个json响应的最佳方法是什么?谢谢 !!Ruby:如何使用数组或哈希映射对json响应进行排序
this is the model: 1 Series
this is the identifier: Convertible
this is the model: 1 Series
this is the identifier: Coupe
this is the model: 1 Series M
this is the identifier: Coupe
this is the model: 3 Series
this is the identifier: Convertible
this is the model: 3 Series
this is the identifier: Coupe
this is the model: 3 Series
this is the identifier: Diesel
this is the model: 3 Series
this is the identifier: Sedan
this is the model: 3 Series
this is the identifier: Wagon
this is the model: ALPINA B7
this is the identifier: Sedan
this is the model: ActiveHybrid 5
this is the identifier: Sedan
this is the model: ActiveHybrid 7
this is the identifier: Sedan
this is the model: ActiveHybrid X6
this is the identifier: SUV
但是你试过了什么?欢迎! – megas 2012-07-27 19:08:08