I want to invoke method a from method of module B. How can I do it? I don't want to specify A::a every time.
module A
def self.a
"a"
end
end
module B
extend A
def self.b
a
end
end
p B::b # => undefined local variable or method `a' for B:Module
ais a class method onAif you haddef aand notdef self.ait would work as expected, otherwise useincludeinstead ofextendA::ato be a class method?extendsmechanism as in quandary's answer.A::ashould be module method. sorry