Looking for gem or at least idea how to approach this problem, the ones I have are not exactly elegant 🙂
Idea is simple I would like to map hashes such as:
{ :name => 'foo',
:age => 15,
:job => {
:job_name => 'bar',
:position => 'something'
...
}
}
To objects of classes (with flat member structure) or Struct such as:
class Person {
@name
@age
@job_name
...
}
Thanks all.
Assuming that you can be certain sub-entry keys won’t conflict with containing entry keys, here’s some code that should work…