I want to build a structure of nested objects without creating models for each of them. This structure should be used for intermediate calculations, for display purposes only and not persist in database.
What is the right Rails-way to make object with array of nested objects inside?
Could be models created without intention to persist in database? Is this the right way to create objects?
Ruby is dynamic-typed language. How to limit objects in the nested array to specific class only?
As I understand, attr_accessor is an equivalent to object's field in other programming languages. How to declare that this field should be of specific class type only?