How is visibility of methods changed in ruby (encapsulation) ?



How is visibility of methods changed in ruby (encapsulation) ?..

Answer / Kamlesh Bhumarkar

In Ruby, you can control the visibility of methods by changing their names. Private methods start with a single underscore (_), protected methods start with double underscores (__) and public methods have no special prefix. Class methods are automatically public.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby on Rails Interview Questions

What are filters? and how many types of filters are there in ruby

2 Answers   Baidu, TCS,


Why ruby on rails is used for?

1 Answers  


How would you create a controller for the subject?

1 Answers  


What is the naming convention for variables?

1 Answers  


How many types of associations relationships does a model have?

1 Answers  


What is the symbol garbage collector?

1 Answers  


what is the role of Rails Controller?

1 Answers  


Explain the features of ruby on rails.

1 Answers  


I would like to know about ruby on rails.I want to know.how will be the future for ruby on rails.please tell me.

9 Answers   Baidu, TCS,


Is ruby on rails dying?

1 Answers  


What is rake?

1 Answers  


How is calling super() different from the super call?

1 Answers  


Categories