activeresource 2.3.18 → 3.0.0.beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

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