title: Any good way of returning the max depth of a nested hash in Ruby
body: <p>The Hash object looks as follows, it has both array and hash values, but the nest always happens at the value for the "children" array:</p>
  
  <pre><code>a = {"id" =&gt; "1", "children" =&gt; [{"id"=&gt;"11", "children"=&gt;[{"id"=&gt;"111"}]}, {"id"=&gt;"12", "children"=&gt;[{"id"=&gt;"121", "children"=&gt;[{"id"=&gt;"1211"}]}, {"id"=&gt;"122"}]}]}
  a.max_depth = 3
  </code></pre>