I have an object created, and I want, based on some conditional check, to add some attributes to this object. How can I do this? To explain what I want:
A=O
You can use instance_variable_set to set a variable on an instance of the Object class (and instance_variable_get to get it.) The Object class doesn't have any attributes you can set directly.
However, I suspect this is not the best solution for what you are trying to achieve; it is not the norm to directly work with the Object class, but rather to define or use classes that inherit from it, that have the attributes you want to work with.