How would you freeze an object in ruby? Can you provide a simple example?
Answer Posted / 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 |
Post New Answer View All Answers