As we know, the private methods cannot be called with an explicit receiver in ruby. But when I define a class, I can invoke a private class method by the class itself.
For example:
class A
private
def self.test
puts "hello,world!"
end
end
A.test => hello,world!
A.new.test NoMethodError: private method `test' called for #<A:0x007f80b91a10f8>
it is contradictory with the definition of private. Anyone can tell me the reason. Thanks in advance!