Module: Counter::Cache

Defined in:
lib/counter/cache.rb,
lib/counter/cache/redis.rb,
lib/counter/cache/config.rb,
lib/counter/cache/version.rb,
lib/counter/cache/options_parser.rb,
lib/counter/cache/active_record_updater.rb,
lib/counter/cache/counters/buffer_counter.rb,
lib/counter/cache/counters/buffer_counter/key.rb,
lib/counter/cache/counters/buffer_counter/saver.rb,
lib/counter/cache/counters/buffer_counter/updater.rb,
lib/counter/cache/counters/buffer_counter/enqueuer.rb,
lib/counter/cache/counters/buffer_counter/relation_finder.rb

Defined Under Namespace

Modules: Counters Classes: ActiveRecordUpdater, Config, OptionsParser, Redis

Constant Summary collapse

VERSION =
"0.3.0"

Class Method Summary collapse

Class Method Details

.configurationObject



15
16
17
# File 'lib/counter/cache.rb', line 15

def self.configuration
  @configuration ||= Counter::Cache::Config.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



11
12
13
# File 'lib/counter/cache.rb', line 11

def self.configure
  yield configuration
end

.included(base) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/counter/cache.rb', line 19

def self.included(base)
  base.instance_eval do
    def counter_cache_on(options)
      after_create ActiveRecordUpdater.new(options)
      after_destroy ActiveRecordUpdater.new(options)
    end
  end
end