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 |
Does hash use “ #==” or “#eql?” To compare hash keys?
What are differences between ruby and python?
Explain raise statement in Ruby?
Please explain what are some advantages of using ruby?
In how many ways items can be removed from array in Ruby?
Tell us the types of variables available in ruby class?
Explain redo statement in Ruby?
How symbol is different from variables?
Explain when self.up and self.down method is used?
Explain about the programming language ruby?
What is Ruby programming language?
difference between activesupport's “hashwithindifferentaccess” and ruby's “hash”?