ruby-1.9.2-p0 :037 > data = [["a", 1], ["b", 2], ["c", 3]] => [["a", 1], ["b", 2], ["c", 3]] ruby-1.9.2-p0 :039 > h = Hash[*data.flatten] => {"a"=>1, "b"=>2}
ruby-1.9.2-p0 :048 > ar = *h => [["a", 1], ["b", 2]]
No comments:
Post a Comment