ismasan/oat — pull request #19 by kjg (2014-02-17 18:37:42+00:00)
Title: Serializer from block or class update take two

I think this is basically what you were proposing.

I don't particularly like this.

Why is having adapter writers know to use oat/data in places of hashes any better than having them know to call .to_hash on sub-serializers when writing to the data object?

Plus, Adapter writers still need to know to call to_hash to implement functionality similar to json_api's #entity_without_root

Maybe json_api needs to be taking advantage of Oat::Serializer#top instead. I'm going to spike out a branch real quick to see if none of this is needed if json_api adapter uses #top