See here for how to traverse a nested model.
For each entity, you can then get the information that you need (name or attributes or area etc.). Maybe you need to check the entity type (with is_a?
) because not all entities have the same methods and properties. For some you need to take the transformation into consideration (e.g. area).