a guest Aug 10th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- 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