adspace


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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the current version of ruby on rails?

949