# File lib/mongo/utils/core_ext.rb, line 49 def mongo_thread_local_accessor name, options = {} m = Module.new m.module_eval do class_variable_set :"@@#{name}", Hash.new {|h,k| h[k] = options[:default] } end m.module_eval %{ def #{name} @@#{name}[Thread.current.object_id] end def #{name}=(val) @@#{name}[Thread.current.object_id] = val end } class_eval do include m extend m end end
Generated with the Darkfish Rdoc Generator 2.