【发布时间】:2014-08-28 02:21:23
【问题描述】:
我想获取扩展类的类的类名。那句话可能没有多大意义,所以我会用代码解释。
class Alpha
store lambda{
# Is it possible to reference
# Beta somehow? I need to get
# the classname of the extendee,
# if that's even a real word.
# Returns Alpha, I need Beta.
self.name
}.call
end
class Beta < Alpha; end
有什么想法吗?
【问题讨论】:
标签: ruby class inheritance