Ruby Developer Question:

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

Ruby Developer Interview Question
Ruby Developer Interview Question

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.


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?