bzproxies 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bzproxies/base.rb +6 -1
- data/lib/bzproxies/version.rb +1 -1
- data/spec/base_spec.rb +5 -0
- data/spec/fixtures/base.rb +6 -0
- metadata +1 -1
data/lib/bzproxies/base.rb
CHANGED
@@ -55,9 +55,14 @@ module Proxies
|
|
55
55
|
@proxies.flatten!
|
56
56
|
@proxies.compact!
|
57
57
|
end
|
58
|
+
|
59
|
+
def __getobj__
|
60
|
+
@target
|
61
|
+
end
|
62
|
+
|
58
63
|
|
59
64
|
def method_missing m, *args, &block
|
60
|
-
|
65
|
+
__getobj__.__send__ m, *args, &block
|
61
66
|
end
|
62
67
|
end
|
63
68
|
end
|
data/lib/bzproxies/version.rb
CHANGED
data/spec/base_spec.rb
CHANGED
@@ -88,6 +88,11 @@ describe Proxies::Base do
|
|
88
88
|
(a.equal? inherited).should be_false
|
89
89
|
(a.equal? proxy).should be_false
|
90
90
|
end
|
91
|
+
|
92
|
+
it "should use __getobj__ for method_missing if exists" do
|
93
|
+
t = Tester.new({:test => {"tatata" => 1}})
|
94
|
+
t["tatata"].should == 1
|
95
|
+
end
|
91
96
|
|
92
97
|
|
93
98
|
|
data/spec/fixtures/base.rb
CHANGED