我正在尝试获取我的子类的父模块的名称:
module Special
class BaseController
def self.action
puts Module.nesting.inspect # i want this to be relative to self
end
end
end
module Foobar
class Controller < Special::BaseController
action do
# should print Foobar::Controller
end
end
end
如何获取子类的父模块而不是基类?