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 |
What is yield statement in ruby.
Explain about operators in Ruby?
How to write multiline string in Ruby?
What is request.xhr?
Explain the difference between a single quote and double quote?
Tell me what is the command to create a migration?
How to access Ruby array elements? How many methods are used to access Ruby elements?
What are the object-oriented programming features supported by ruby?
Explain about the defined operator in ruby?
Please explain what are some advantages of using ruby?
What are the operators available in ruby?
Tell us what is the difference between dynamic and static scaffolding?