提交 a506bac5 编写于 作者: X Xavier Noria

fixes Module#anonymous? for 1.9

上级 aa82bdf9
class Module
require 'active_support/core_ext/object/blank'
class Module
# A module may or may not have a name.
#
# module M; end
......@@ -15,6 +17,8 @@ class Module
# m.name # => "M"
#
def anonymous?
name == ''
# Uses blank? because the name of an anonymous class is an empty
# string in 1.8, and nil in 1.9.
name.blank?
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册