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

What is yield statement in ruby.

1 Answers  


Explain about operators in Ruby?

1 Answers  


How to write multiline string in Ruby?

1 Answers  


What is request.xhr?

1 Answers  


Explain the difference between a single quote and double quote?

1 Answers  


Tell me what is the command to create a migration?

1 Answers  


How to access Ruby array elements? How many methods are used to access Ruby elements?

1 Answers  


What are the object-oriented programming features supported by ruby?

1 Answers  


Explain about the defined operator in ruby?

1 Answers  


Please explain what are some advantages of using ruby?

1 Answers  


What are the operators available in ruby?

1 Answers  


Tell us what is the difference between dynamic and static scaffolding?

1 Answers  


Categories