Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is the difference extend and include?



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

Post New Answer

More Ruby Interview Questions

Explain the role of modules and mixins in ruby?

1 Answers  


How to access Ruby strings elements in an application?

1 Answers  


What are Ruby iterators?

1 Answers  


Explain Ruby exceptions?

1 Answers  


Tell me what is the command to create a migration?

1 Answers  


Tell us the types of variables available in ruby class?

1 Answers  


what is the difference between a single quote and double quote?

1 Answers  


Explain about portability?

1 Answers  


How many iterators are there in ruby?

1 Answers  


Explain retry statement in ruby.

1 Answers  


Explain the garbage collection feature of ruby?

1 Answers  


Difference between render and redirect?

1 Answers  


Categories