Ruby Developer Question: Download Ruby Developer PDF

Please explain the three levels of access control for Ruby methods?

Tweet Share WhatsApp

Answer:

In Ruby, methods may either be public, protected, or private. Public methods can be called by anyone. Protected methods are only accessible within their defining class and its subclasses. Private methods can only be accessed and viewed within their defining class.

Download Ruby Developer PDF Read All 74 Ruby Developer Questions
Previous QuestionNext Question
Tell me what is the function of garbage collection in Ruby on Rails?Can you list out the few features of Ruby?