Commit 8cfc1a1

mo khan <mo@mokhan.ca>
2013-03-16 03:38:18
raise an error when invoking a method that does not exist on the target.
1 parent cecdb49
interceptor_registration.rb
@@ -12,7 +12,7 @@ module Booty
 
     def intercept(instance)
       proxy= Proxy.new(instance)
-      proxy.add(@method, @interceptor)
+      proxy.add_interceptor(@method, @interceptor)
       proxy
     end
   end
proxy.rb
@@ -6,7 +6,7 @@ module Booty
       @target = target
     end
 
-    def add(method, interceptor)
+    def add_interceptor(method, interceptor)
       self.class.define_method(method.to_sym) do |*args|
         interceptor.intercept(create_invocation_for(method, args))
       end