Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 22 lines (20 sloc) 0.576 kb
7bd3373 Jeremy Kemper Introduce ActiveSupport::BasicObject which bridges Builder::BlankSlate a...
jeremy authored
1 module ActiveSupport
50bbc87 Jeremy Kemper MacRuby: BasicObject unavailable
jeremy authored
2 if defined? ::BasicObject
dd15a3f Jeremy Kemper Prefer a less intrusive BlankSlate-alike that doesn't hook Object# and K...
jeremy authored
3 # A class with no predefined methods that behaves similarly to Builder's
4 # BlankSlate. Used for proxy classes.
7bd3373 Jeremy Kemper Introduce ActiveSupport::BasicObject which bridges Builder::BlankSlate a...
jeremy authored
5 class BasicObject < ::BasicObject
6 undef_method :==
7 undef_method :equal?
ff47ba9 Jeremy Kemper Ruby 1.9 compat: add #raise to AS::BasicObject, fixup Duration argument ...
jeremy authored
8
9 # Let ActiveSupport::BasicObject at least raise exceptions.
10 def raise(*args)
11 ::Object.send(:raise, *args)
12 end
7bd3373 Jeremy Kemper Introduce ActiveSupport::BasicObject which bridges Builder::BlankSlate a...
jeremy authored
13 end
14 else
dd15a3f Jeremy Kemper Prefer a less intrusive BlankSlate-alike that doesn't hook Object# and K...
jeremy authored
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
7bd3373 Jeremy Kemper Introduce ActiveSupport::BasicObject which bridges Builder::BlankSlate a...
jeremy authored
20 end
34b5767 Jeremy Kemper Introduce BasicObject as Builder::BlankSlate for Ruby 1.9 forward compat...
jeremy authored
21 end
Something went wrong with that request. Please try again.