I have the following hash:
hash = {\'name\' => { \'Mike\' => { \'age\' => 10, \'gender\' => \'m\' } } }
I can access the age by:
If you don't want to monkey patch the standard Ruby class Hash use .fetch(x, {}) variant. So for the example above will look like that:
Hash
.fetch(x, {})
hash.fetch('name', {}).fetch('Mike', {}).fetch('age')