I have a string that represents a sequence of keys in a nested hash in the following format:
keys = 'key1[key2]'
and a nested hash that has the corresponding keys like the following:
hash = {key1: {key2: 'value'}}
Is there any way to get the value from this hash directly as in the following?
value = hash[keys]
Or, do I have to write my own logic?
'key1[key2][key3]'or'key1[key2[key3]]'?