File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
activesupport/lib/active_support Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 1
- # A base class with no predefined methods that tries to behave like Builder's
2
- # BlankSlate in Ruby 1.9. In Ruby pre-1.9, this is actually the
3
- # Builder::BlankSlate class.
4
- #
5
- # Ruby 1.9 introduces BasicObject which differs slightly from Builder's
6
- # BlankSlate that has been used so far. ActiveSupport::BasicObject provides a
7
- # barebones base class that emulates Builder::BlankSlate while still relying on
8
- # Ruby 1.9's BasicObject in Ruby 1.9.
9
1
module ActiveSupport
10
2
if defined? ::BasicObject
3
+ # A class with no predefined methods that behaves similarly to Builder's
4
+ # BlankSlate. Used for proxy classes.
11
5
class BasicObject < ::BasicObject
12
6
undef_method :==
13
7
undef_method :equal?
@@ -18,7 +12,10 @@ def raise(*args)
18
12
end
19
13
end
20
14
else
21
- require 'blankslate'
22
- BasicObject = BlankSlate
15
+ class BasicObject #:nodoc:
16
+ instance_methods . each do |m |
17
+ undef_method ( m ) if m . to_s !~ /(?:^__|^nil\? $|^send$|^object_id$)/
18
+ end
19
+ end
23
20
end
24
21
end
You can’t perform that action at this time.
0 commit comments