Module: ActiveTools::CoreExtension::RuntimeCaching

Defined in:
lib/active_tools/core_extension/runtime_caching.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_runtime_caching(*args) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/active_tools/core_extension/runtime_caching.rb', line 4

def acts_as_runtime_caching(*args)
  options = args.extract_options!
  args.each do |method|
    instance_eval "      def \#{method}\n        ::Thread.current[:\#{method}]\n      end\n\n      def \#{method}=(value)\n        ::Thread.current[:\#{method}] = (value)\n      end\n    DELEGATORS\n  end\nend\n"