<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -24,37 +24,19 @@ module Roxy
           options[:to] = original_method
         end
         
-        roxy_proxy_methods[name] = [options, block]
-        
-        # If we have a no-arg method we're proxying, or if we're not
-        # proxying an existing method at all, we can do a basic def
-        # and memoize the proxy
+        # Thanks to Jerry for this simplification of my original class_eval approach
+        # http://ryandaigle.com/articles/2008/11/10/implement-ruby-proxy-objects-with-roxy/comments/8059#comment-8059
         if !original_method or original_method.arity == 0
-          class_eval &lt;&lt;-EOS, __FILE__, __LINE__
-            def #{name}
-              @#{name}_proxy ||= Proxy.new(self, self.class.roxy_proxy_methods[:#{name}][0],
-                                                 nil,
-                                                 &amp;self.class.roxy_proxy_methods[:#{name}][1])
-            end
-          EOS
-          
-        # If we have a proxied method with arguments, we need to
-        # retain them
+          define_method name do
+            (@proxy_for ||= {})[name] ||= Proxy.new(self, options, nil, &amp;block)
+          end
         else
-          class_eval &lt;&lt;-EOS, __FILE__, __LINE__
-            def #{name}(*args)
-              Proxy.new(self, self.class.roxy_proxy_methods[:#{name}][0],
-                              args,
-                              &amp;self.class.roxy_proxy_methods[:#{name}][1])
-            end
-          EOS
-                              
-        end        
-      end
-            
-      def roxy_proxy_methods
-        @roxy_proxy_methods ||= {}
+          define_method name do |*args|
+            Proxy.new(self, options, args, &amp;block)
+          end
+        end      
       end
+      
     end
   end
 end
\ No newline at end of file</diff>
      <filename>lib/roxy/moxie.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>98fd51d7adf630ae3d3759b13dc1483d19a4bb5a</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Daigle</name>
    <email>ryan.daigle@gmail.com</email>
  </author>
  <url>http://github.com/yfactorial/roxy/commit/893a0d5c22766551415007ff2129d4f4bb6cb53c</url>
  <id>893a0d5c22766551415007ff2129d4f4bb6cb53c</id>
  <committed-date>2008-11-22T07:27:41-08:00</committed-date>
  <authored-date>2008-11-22T07:27:41-08:00</authored-date>
  <message>Made proxy method more concise</message>
  <tree>912bdecfa8753fcdd21a5a6f4648ae128cc5f80c</tree>
  <committer>
    <name>Ryan Daigle</name>
    <email>ryan.daigle@gmail.com</email>
  </committer>
</commit>
