How would you freeze an object in ruby?
Answer / Rewti Raman Singh
To freeze an object in Ruby, you use the Object#freeze method. Once frozen, the object cannot be modified, and attempts to modify it will result in a RuntimeError.
| Is This Answer Correct ? | 0 Yes | 0 No |
Tell me how symbol is different from variables?
Explain me what the difference is between false and nil in ruby?
How would you freeze an object in ruby?
Please explain the three levels of access control for ruby methods?
How can you removed from array in ruby?
How an exception is handled in Ruby?
Explain ruby class.
Tell us what is class libraries in ruby?
How is an iterator handled in ruby?
Difference between render and redirect?
How would you freeze an object in ruby? Can you provide a simple example?
How to open a file in Ruby?