Ruby – Protected Methods

Protected methods is something that is very rarely used, so I have skipped this for now.


I have released my new course on Udemy, Kubernetes By Example. Sign up now to get free lifetime access!

Lets say you have two obects in instantiated from the same class:

– objectA
– objectB

Let’s also say you have a protected method called “prot_method”.

In order to apply this method on objectB, then you can do it indirectly via applying a method to objectA, and passing objectB as a parameter into that object.

See “excerpt section of this post”