作者:泉州联合网2534 | 来源:互联网 | 2023-09-06 11:19
I have feeling, that if one defines a method
我感觉,如果定义一个方法
def test
puts 'Hi'
end
then there is a class to which this method belongs to (i.e. Unknown#test
). So one probably has a possibility to list all methods defined "outside" of other classes. Or there is another way to do such listing?
然后有一个这个方法所属的类(即Unknown #test)。因此,人们可能会列出在其他类“外部”定义的所有方法。或者有另一种方式来做这样的上市?
4 个解决方案