Ruby:|Ruby: Access Control

intro

  • public : accessible both outside and inside class
  • protected & private : only accessible inside class itself and its subclasses
  • protected : can be called with an explicit receiver
  • private : can only called by implicit self

    推荐阅读