2007-12-28 06:14:18 -05:00
|
|
|
module ActiveSupport
|
2008-07-28 00:44:53 -04:00
|
|
|
if defined? ::BasicObject
|
2009-03-21 05:52:56 -04:00
|
|
|
# A class with no predefined methods that behaves similarly to Builder's
|
|
|
|
# BlankSlate. Used for proxy classes.
|
2007-12-28 06:14:18 -05:00
|
|
|
class BasicObject < ::BasicObject
|
|
|
|
undef_method :==
|
|
|
|
undef_method :equal?
|
2008-01-02 04:08:14 -05:00
|
|
|
|
|
|
|
# Let ActiveSupport::BasicObject at least raise exceptions.
|
|
|
|
def raise(*args)
|
|
|
|
::Object.send(:raise, *args)
|
|
|
|
end
|
2007-12-28 06:14:18 -05:00
|
|
|
end
|
|
|
|
else
|
2009-03-21 05:52:56 -04:00
|
|
|
class BasicObject #:nodoc:
|
|
|
|
instance_methods.each do |m|
|
|
|
|
undef_method(m) if m.to_s !~ /(?:^__|^nil\?$|^send$|^object_id$)/
|
|
|
|
end
|
|
|
|
end
|
2007-12-28 06:14:18 -05:00
|
|
|
end
|
2007-10-06 21:07:00 -04:00
|
|
|
end
|