Simple example:
class Example def methodA end private # all methods that follow will be made private: not accessible for outside objects def methodP end end
If private is invoked without arguments, it sets access to private for all subseqent methods. It can also be invoked with named arguments.
Named private method example:
class Example def methodA end def methodP end private :methodP end
Here private was invoked with an argument, altering the visibility of methodP to private.