diff options
-rw-r--r-- | activesupport/lib/active_support/basic_object.rb | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/activesupport/lib/active_support/basic_object.rb b/activesupport/lib/active_support/basic_object.rb index 3b5277c205..c3c7ab0112 100644 --- a/activesupport/lib/active_support/basic_object.rb +++ b/activesupport/lib/active_support/basic_object.rb @@ -1,21 +1,14 @@ 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 |