提交 3f967dc5 编写于 作者: V Vishnu Atrai

::BasicObject always defined in ruby 19

上级 fc4f56ad
module ActiveSupport
if defined? ::BasicObject
# A class with no predefined methods that behaves similarly to Builder's
# BlankSlate. Used for proxy classes.
class BasicObject < ::BasicObject
undef_method :==
undef_method :equal?
# A class with no predefined methods that behaves similarly to Builder's
# BlankSlate. Used for proxy classes.
class BasicObject < ::BasicObject
undef_method :==
undef_method :equal?
# Let ActiveSupport::BasicObject at least raise exceptions.
def raise(*args)
::Object.send(:raise, *args)
end
end
else
class BasicObject #:nodoc:
instance_methods.each do |m|
undef_method(m) if m.to_s !~ /(?:^__|^nil\?$|^send$|^object_id$)/
end
# Let ActiveSupport::BasicObject at least raise exceptions.
def raise(*args)
::Object.send(:raise, *args)
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册