asenchi/scrolls — pull request #36 by asenchi (2013-08-28 00:54:43+00:00)
Title: Add support for single nested hashes.

I'm actually curious about what people think of this, is it worth it?

@wuputah opened #25 months ago but at the time I wasn't sure it was useful, however, I've finally hit a point where it would be.

Obviously this is something that could get out of hand, I don't think Scrolls should ever be concerned with hashes nested more than one deep, but a single nested hash actually works out pretty nicely.

I've chosen the '.' as a hash separator for a couple of reasons:

* In general keys should match `\w+`, so using a '_' as @wuputah suggests would become impossible to parse.
* ':' is used in Time formats and should, I think, be left alone with regards to keys.
* The [TOML spec](https://github.com/mojombo/toml#hash) uses '.' for key groups.

As an explanation here is what this PR gets us:

```ruby
log_this = {
"rid" => "blah-blah-blah",
"data" => {
"req_method" => "get",
"req_path" => "/emoji"
}
}
```

Parses to:

```
rid=blah-blah-blah data.req_method=get data.req_path=/emoji
```