hide a little more the wrap machinery
authorGuillaume Cottenceau <gcottenc@gmail.com>
Wed, 2 Jul 2008 08:15:42 +0000 (10:15 +0200)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Wed, 2 Jul 2008 08:15:42 +0000 (10:15 +0200)
lib/booh/Synchronizator.rb

index 192f6ca97ddf67c17524dd407614802ce56b9ba7..322630196428495c99accaedaa977ae39a100e9f 100644 (file)
@@ -26,16 +26,16 @@ require 'monitor'
 
 class ObjectWrapper
     def initialize(wrapped_object)
-        @wrapped_object = wrapped_object
+        @__wrapped_object = wrapped_object
     end
     def method_missing(id, *args, &block)
-        wrap(id, *args, &block)
+        __wrap(id, *args, &block)
     end
-    def wrap(id, *args, &block)
+    def __wrap(id, *args, &block)
         if block.nil?
-            return @wrapped_object.__send__(id, *args)
+            return @__wrapped_object.__send__(id, *args)
         else
-            return @wrapped_object.__send__(id, *args) { |*args2| block.call(*args2) }
+            return @__wrapped_object.__send__(id, *args) { |*args2| block.call(*args2) }
         end
     end
 end
@@ -43,10 +43,10 @@ end
 class Synchronizator < ObjectWrapper
     def initialize(wrapped_object)
         super
-        @wrapped_object.extend(MonitorMixin)
+        @__wrapped_object.extend(MonitorMixin)
     end
-    def wrap(id, *args, &block)
-        @wrapped_object.synchronize {
+    def __wrap(id, *args, &block)
+        @__wrapped_object.synchronize {
             super(id, *args, &block)
         }
     end