Module: PoolParty::ThreadSafeInstance::ClassMethods

Defined in:
lib/modules/safe_instance.rb

Instance Method Summary collapse

Instance Method Details

#make_safe(meth) ⇒ Object



11
12
13
14
15
16
# File 'lib/modules/safe_instance.rb', line 11

def make_safe(meth)
 original_method = "_unsafe_#{meth}_"
 alias_method original_method, meth
 define_method(meth) {|*args| self.class.synchronize { self.send(original_method) } }
 self
end