test.rb
print self
print self.class
def hello()
print "message"
end
puts object_id
puts self.object_id
hello
self.hello
输出
main
Object
直接调用 hello 正常
self.hello 报错
:in <main>': private method
hello' called for main:Object (NoMethodError)