bzproxies 0.1.5 → 0.1.6

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.
@@ -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
- @target.__send__ m, *args, &block
65
+ __getobj__.__send__ m, *args, &block
61
66
  end
62
67
  end
63
68
  end
@@ -1,3 +1,3 @@
1
1
  module Bzproxies
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
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
 
@@ -5,3 +5,9 @@ class Inherited < Proxy
5
5
  true
6
6
  end
7
7
  end
8
+
9
+ class Tester < Proxy
10
+ def __getobj__
11
+ @target[:test]
12
+ end
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bzproxies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: