Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- puts "Hello World"
- class AccessControllTester
- def private_method
- puts 'private_method'
- end
- def protected_method
- puts 'protected_method'
- end
- def public_method
- puts 'public_method'
- end
- def interesting_method(same_class_instance)
- same_class_instance.protected_method
- end
- private :private_method
- protected :protected_method
- end
- act1 = AccessControllTester.new
- act1.public_method
- act2 = AccessControllTester.new
- act2.interesting_method act1
Add Comment
Please, Sign In to add comment