is there any way to save ruby objects in sketchup model file ?
What is a ‘ruby object’ ?
If you mean embedding some ruby code, then it could be added to enduring entities in the model, or the model itself - as a string value of an attribute.
However, you will still then need some external ruby code to have been loaded from a Plugins folder RB file, which will then have methods to extract that embedded string and process it - perhaps using eval…
Since that external RB is needed, then ALL of the ruby code could be loading from the Plugins folder RB file, and the model-specific data it needs can be got from the attribute value[s] saved with the model…
I can’t see a situation where having ruby code embedded in the model would be useful, even if it were do-able and usable without an external RB file…
TIG cut right to it: it depends on what you mean by a “Ruby object.” Basic Ruby types can be stored without doing anything special.
It also depends on what exactly your goal is. What are you actually trying to do in a broader sense?