1.9.3-p286 :039 > (0...x.right.first.chem_species.size).each do |atom|
1.9.3-p286 :040 > puts x.right.first.chem_species[atom]
1.9.3-p286 :041?> end
H
2
O
1
=> 0...2
1.9.3-p286 :042 > x.right.first.chem_species[0]
=> ["H", 2]
1.9.3-p286 :043 >
不同的價值,爲什麼不賣出期權輸出 ["H",2]
然後["O",1]
。 (作爲第二種方法返回)。這似乎並不正確通過數組的數組迭代返回比預期
什麼是'chem_species'類 - 它是一個哈希? – PinnyM 2013-02-17 04:35:39
x.right.first.chem_species.class - > Array – 2013-02-17 04:43:37