[ create a new paste ] login | about

Link: http://codepad.org/WCHqAaI4    [ raw code | output | fork ]

Ruby, pasted on May 10:
1
2
3
4
5
input = { :result => [ {:id => 378, :name => 'Pete'}, {:id => 567, :name => 'Pete'} ] }

ids = input[:result].map{ |obj| obj[:id] }

puts ids.inspect


Output:
1
[378, 567]


Create a new paste based on this one


Comments: