module Sequel::Plugins::QueryCache

Constants

MAJOR_VERSION
MINOR_VERSION
TINY_VERSION
VERSION

Public Class Methods

configure(model, store, opts={}) click to toggle source
# File lib/sequel-query-cache.rb, line 11
def self.configure(model, store, opts={})
  model.instance_eval do
    @cache_options = {
      :ttl => 3600,
      :cache_by_default => {
        :always => false,
        :if_limit => 1
      }
    }.merge(opts)

    @cache_driver = Driver.from_store(
      store,
      :serializer => @cache_options.delete(:serializer)
    )
  end
end
version() click to toggle source
# File lib/sequel-query-cache/version.rb, line 10
def self.version; VERSION; end