what is the difference extend and include?
Answer / Nalinaksh Punj Gautam
In Ruby, include adds methods and constants from one module to another as instance methods. Extend adds them as private instance methods. When you use include, it modifies the receiving object directly, while extend creates a new singleton class for the receiver and includes the module into it.
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain the role of modules and mixins in ruby?
How to access Ruby strings elements in an application?
What are Ruby iterators?
Explain Ruby exceptions?
Tell me what is the command to create a migration?
Tell us the types of variables available in ruby class?
what is the difference between a single quote and double quote?
Explain about portability?
How many iterators are there in ruby?
Explain retry statement in ruby.
Explain the garbage collection feature of ruby?
Difference between render and redirect?