I have a class method, self.calculate, that I want to invoke from both another class method and from an instance method.
If I write
def green
calculate(x,y,z)
end
though, I get a NoMethodError: undefined method 'calculate' exception. Invoking self.calculate gets the same problem.
What does work is calling MyClassName.calculate, but that seems somehow wrong and messy. What is the correct practice in this situation?
MyClassName.calculateshould not work ifcalculateisprivateas you claim.