vendredi 20 octobre 2017

How to get values of all nested fields given their names?

Say we have a class instance foo and foo.bar == 42 and foo.box.bar == 34 and there can be more bar's in there. How to gather all bar values from a class instance (and all nested within) as an array [42, 34]?





Aucun commentaire:

Enregistrer un commentaire