1.

Name the three levels of access control for Ruby methods

Answer»
  • In Ruby, methods may either be PUBLIC, protected, or private. 
  • Public methods enforce no ACCESS control -- they can be called in any scope. 
  • Protected methods are only accessible within their defining class and its subclasses. 
  • Private methods can only be ACCESSED and viewed within their defining class . They are only accessible within the context of the current OBJECT


Discussion

No Comment Found