以下是可能的吗?
puts A::B::C.new.namespace_path # => [:A,:B], or even [A,B]
我想也许你要找的是祖先。
或者你只是想 self.class.to_s.split("::")
self.class.to_s.split("::")