How would you freeze an object in ruby? Can you provide a simple example?
Answer / Shiv Pratap Singh
In Ruby, include adds a module's methods to an existing object as if they were defined locally. The receiver keeps its original identity and methods. Extend, on the other hand, defines the methods as part of the receiver's class, allowing the receiver to inherit any new methods created by the included module.
| Is This Answer Correct ? | 0 Yes | 0 No |
Interpolation is a very important process in Ruby, comment.
How would you freeze an object in ruby? Can you provide a simple example?
what is the Notation used for denoting class variables in Ruby?
Tell me how you can list all routes for an application?
Do you know when self.up and self.down method is used?
What are the object-oriented programming features supported by ruby?
How many types of associations relationships does a model has?
List some features of ruby?
Explain about class libraries in ruby?
How will you rename and delete a file in Ruby?
Tell me what does ruby name refers to?
Explain about operators in Ruby?