Sha256: 75bd2250eed09bcdbd78ac973042c32c7ec05262df52ae42693adfac708ea4ee

Contents?: true

Size: 518 Bytes

Versions: 38

Compression:

Stored size: 518 Bytes

Contents

module ActiveTools
  module CoreExtension
    module RuntimeCaching
      def acts_as_runtime_caching(*args)
        options = args.extract_options!
        args.each do |method|
          instance_eval <<-DELEGATORS
            def #{method}
              ::Thread.current[:#{method}]
            end

            def #{method}=(value)
              ::Thread.current[:#{method}] = (value)
            end
          DELEGATORS
        end
      end
      
      ::Class.send(:include, RuntimeCaching)
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
active_tools-0.2.5 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.2.4 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.2.3 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.2.2 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.2.1 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.2.0 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.1.4 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.1.3 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.1.2 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.1.1 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.1.0 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.0.52 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.0.51 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.0.50 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.0.42 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.0.41 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.0.40 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.0.39 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.0.38 lib/active_tools/core_extension/runtime_caching.rb
active_tools-0.0.37 lib/active_tools/core_extension/runtime_caching.rb