How Can I Convert Nested YAML to nested Arrays and OpenStructs in Ruby
问题 How should I convert a series of nested hashes (nested to arbitrary depth) to a series of nested OpenStructs? I'm loading in a big YAML file and I'm not enjoying accessing['everything']['like']['this'] . I have found a few partial solutions using Google, but I thought this would make a nice question here. Here is one of the solutions I found from http://andreapavoni.com/blog/2013/4/create-recursive-openstruct-from-a-ruby-hash: # deep_struct.rb require 'ostruct' class DeepStruct < OpenStruct