Created
August 10, 2010 09:11
-
-
Save beenhero/516959 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? | |
# 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 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment