You can make this code work by removing the self
keyword from public_method
invocation.
class C
def public_method
self.private_method
end
private
def private_method; end
end
C.new.public_method
# => NoMethodError: private method ‘private_method' called [...]