Open the class Moduleand add a method to it:
class Module
def foo
puts "phew"
end
end
I can call this method by doing this,
Class.foo
which is understandable, because the class Classthere Class, which is a superclass Module. therefore, it can call instance methods defined in Module.

Now the method barbelow is defined on Moduleeigenclass:
class Module
def self.bar
puts "bar"
end
end
but now
Class.bar
also works.
Can someone explain to me how Classcan access methods in Moduleeigenclass?
, . , . Class.foo, Class eigenclass, , Module eigenclass BasicObject eigenclass, (, ) Class ( Class BasicObject eigenclass), Module, .
, Class.bar, Class eigenclass, Module eigenclass, .
class Class
def check
puts "class instance method"
end
end
class Module
def self.check
puts "modules eigenclass method"
end
def check
puts "module instance method"
end
end
, wot - , :
Class.check
:
