トップレベル(モジュールやクラスの外)でメソッドを定義するとどうなるでしょうか??トップレベルでは、メソッドを定義するとデフォルトで private なメソッドになるので注意です。 01.#!/usr/bin/ruby 02. 03.p self.class # Object 04.p self # main 05. 06.cmethod = self.class.private_methods 07.imethod = self.private_methods 08. 09.def bar 10. puts "bar method" 11.end 12. 13.p self.class.private_methods - cmethod # ["bar"] 14.p self.private_methods - imethod # ["bar"] 見ての通りですが、なぜかインスタンスメソ