On Jun 2, 2006, at 2:31 PM, Jacob Fugal wrote: > On 6/2/06, Ruby Quiz <james / grayproductions.net> wrote: >> More than a few times I've wished I could get a nice nested >> OpenStruct out of >> YAML data, instead of the more unwieldy nested hashes. It's mostly >> a matter of >> style. It's a straightforward task to convert a nested hash >> structure into a >> nested OpenStruct, but it's the sort of task that you can do a lot >> of ways, and >> I'll bet some of you can come up with more elegant and/or more >> efficient ways >> than I have so far. > > First p0st! > > Ok, I cheated... Hans pointed me at the rubyquiz site before this > showed up in the list, so I got a head start. But in only 15 minutes, > I've got it solved, with only 18 lines (only 5 of those are in method > bodies), sans whitespace. Golfers... go! > > I'd like to thank Hans for a really straightforward (such that I can > do it in my limited time), yet still interesting quiz! > > Jacob Fugal I thought we were waiting to announce completion. I did it in 17 lines, 9 in the body (whitespace included). Plus a unit test and a benchmark. Short and sweet! Thanks Hans! -Mat