a guest Aug 10th, 2018 62 Never
- class Foo
- def m1
- puts "private"
- def m2
- puts "protected"
- private :m1
- protected :m2
- def m3 #Private and Proteceted can be invoked indirectly like this thorough a function
- def m4 #Protected can be invoked thorough a reciever
- def m5 # Private cannot have reciever so self.m1 and Foo.new.m1 will throw error
RAW Paste Data