Recommended/ different ways to access data in templates

I understand MM data has its quirks, as per Can't symbolize keys of data store hashes, but I was wondering how I might be able to achieve something like this with the data object:

- data.some_data_type[0][:some_key]

… which doesn’t work.

Reason being, I’m using Contentful to store site-wide variables, meaning every time I want to reference, say, the site title, in my templates I must:

- data.space.global_vars(0).each do | k, v |
  h1= v[:site_title]

Would greatly appreciate it if anyone knows or can point me in the direction on how to “access it’s (the data object’s) properties in a variety of ways”, as the above-linked thread mentions… I can convert the first level of data to a regular hash (to_h), but am unable (read: don’t know how) to recursively convert the whole lot into a regular hash - if indeed one must do this to achieve something like the above.

Any help - much thanks!

This is what I’ve hacked together in the meantime, which seems to work:

@myData = Hash[*data.data_type_dir(0).map{ |k, v| v.deep_symbolize_keys }]
@myData[:some_key]

Trick seems to be deep_symbolize_keys, which I stumbled upon purely by chance at https://apidock.com/rails/Hash/deep_symbolize_keys