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 |
How to check whether a directory exist or not in Ruby?
What are some built-in ruby class exceptions.
What are blocks and procs?
Explain about Float, Dig and Max?
Explain ruby ranges. What are the ways to define ranges?
Do you know when self.up and self.down method is used?
Tell me what does ruby name refers to?
Do you know how ruby looks up a method to invoke?
Explain about Class variable and global variable?
What is Ruby programming language?
What is the scope of a local variable in ruby?
Explain some of the looping structures available in ruby?