Ok, It’s the direction I took.
It’s a little strange to serialize an object graph in order to be able to validate it.
Do you think it may be a good idea to wrap an ActiveRecord in a kind of Delegator overriding the
def (key) which would call
public_send(key) on its delegate and then wrap it again in the same Kind of Delegator?
That delegator would some kind of adapter for object graphs (in my case ActiveRecord but I can imagine a graph of Poros having the same behavior) to make it look like a hash.
In other terms, what’s the part of the Hash interface that you rely on as input? How hard would it be for another object to quack like a hash?