activeresource 2.3.18 → 3.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activeresource might be problematic. Click here for more details.

data/test/setter_trap.rb DELETED
@@ -1,26 +0,0 @@
1
- class SetterTrap < ActiveSupport::BasicObject
2
- class << self
3
- def rollback_sets(obj)
4
- trapped = new(obj)
5
- yield(trapped).tap { trapped.rollback_sets }
6
- end
7
- end
8
-
9
- def initialize(obj)
10
- @cache = {}
11
- @obj = obj
12
- end
13
-
14
- def respond_to?(method)
15
- @obj.respond_to?(method)
16
- end
17
-
18
- def method_missing(method, *args, &proc)
19
- @cache[method] ||= @obj.send($`) if method.to_s =~ /=$/
20
- @obj.send method, *args, &proc
21
- end
22
-
23
- def rollback_sets
24
- @cache.each { |k, v| @obj.send k, v }
25
- end
26
- end