Ruby - JSON - how to get a specific info?

Here is the following API:
{
“result”: {
“something”: {
“ids”: [
2,
1,
9,
3,
5,
4,
6
],
“type”: 0,
“description”: null
},
“distribution”: [
{
“name”: “joe”,
“age”: 12,
“amount”: “10000000,00”
},
{
“name”: “rony”,
“age”: 13,
“amount”: “10000000,00”
},

],

}

How can I get “age” only?
I can get the full info by: api [“result”][“distribution”]

Thank you in advance.

You are going to want the ages, plural, so the result will be an array.

ages = api['result']['distribution'].collect { |person| person['age'] }

Thank you for your help. It works.