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 |
What are Ruby arrays and how they can be created?
What are the ruby variables?
Tell me an array [1,2,34,5,6,7,8,9], product it using a method?
Explain when self.up and self.down method is used?
What are the only two values that are falsy?
How do you remove nil values in array using ruby?
Explain redo statement in Ruby?
Explain about variables?
Tell us the types of variables available in ruby class?
Explain about ruby names?
Can you call a private method outside a ruby class using its object?
Tell us what is class libraries in ruby?