Ruby Developer Question:

Download Job Interview Questions and Answers PDF

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.

Download Ruby Developer Interview Questions And Answers PDF

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?