When should we consider using private or protected?
问题 Just wondering, when should we actually must use private or protected for some methods in the model? Sometimes I can't not be bothered to group my methods in private nor protected . I just leave it as it is. But I know it must be a bad practice, otherwise these 2 groupings won't be created in programming. Thanks. 回答1: If you plan to call a method externally, record.method() , then "public" If it will be used only internally, self.method() , then "private" If you plan to use it internally, but