Ruby’s private keyword might do a lot less than you think.
The “private” does not apply to class methods defined on self
This does not make anything private:
1 2 3 4 5 6 | |
You need to use private_class_method instead:
1 2 3 4 5 6 7 | |
The “private” does not apply to define_method
This does not make anything private:
1 2 3 4 5 6 | |
You need to use private with an argument instead:
1 2 3 4 5 6 7 | |