2

I'm writing a Ruby object that will be used as the superclass of arbitrary classes that inherit from it. The class has a couple well-defined methods, along with many small utility methods, to factor out some work from the main methods. I want those methods to be invisible from subclasses, with no chance of causing naming conflicts. What is the best practice for this situation?

Edit: By "invisible", I mean that there won't accidentally be naming conflicts or invocations. I realize there will always be sneaky ways to get at class members.

jrdioko
  • 32,230
  • 28
  • 81
  • 120

1 Answers1

0

Make them private and name them def __some_utility_method

However, in Ruby nothing is really ever "invisible"

ErsatzRyan
  • 3,033
  • 1
  • 26
  • 30