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.
record.method()
, then "public"self.method()
, then "private"self.method() # in subclass
, then "protected"If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With