What is the difference between extend and include?
Answer / Vikas Srivastava
In Ruby, "include" allows you to incorporate the methods (and constants) defined in a module into your class or module. On the other hand, "extend" lets you add methods to an existing object without modifying its class.
| Is This Answer Correct ? | 0 Yes | 0 No |
Tell me how can we define ruby regular expressions?
What is the difference between extend and include?
How to write multiline string in Ruby?
In how many ways items can be removed from array in Ruby?
Can you please explain what is the difference between string and symbol?
How does a symbol differ from a string?
How to use ruby methods.
Explain about interpolation?
What is the difference between static and dynamic scaffolding?
Tell me how would you freeze an object in ruby? Can you provide a simple example?
Interpolation is a very important process in Ruby, comment.
How would you freeze an object in ruby? Can you provide a simple example?