提交 cdc42749 编写于 作者: A Aaron Patterson

simplify singleton_class? method

上级 06c52d6a
......@@ -110,12 +110,6 @@ def #{name}?
private
def singleton_class?
# in case somebody is crazy enough to overwrite allocate
allocate = Class.instance_method(:allocate)
# object.class always points to a real (non-singleton) class
allocate.bind(self).call.class != self
rescue TypeError
# MRI/YARV/JRuby all disallow creating new instances of a singleton class
true
!name || '' == name
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册