Sha256: 9f0c3d05e8b96fb53410d297c019f64fd10f9e269efd941e18ccaef7c260d5eb

Contents?: true

Size: 634 Bytes

Versions: 5

Compression:

Stored size: 634 Bytes

Contents

require 'counter/cache/counters/buffer_counter/updater'
require 'counter/cache/counters/buffer_counter/saver'

module Counter
  module Cache
    module Counters
      class BufferCounter
        attr_accessor :source_object, :options

        def initialize(source_object, options)
          @options = Counter::Cache::OptionsParser.new(options)
          @source_object = source_object
        end

        def update(direction)
          Updater.new(source_object, options, self.class.name).update!(direction)
        end

        def save!(&block)
          Saver.new(options).save!(&block)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
counter-cache-0.3.0 lib/counter/cache/counters/buffer_counter.rb
counter-cache-0.2.0 lib/counter/cache/counters/buffer_counter.rb
counter-cache-0.1.0 lib/counter/cache/counters/buffer_counter.rb
counter-cache-0.0.2 lib/counter/cache/counters/buffer_counter.rb
counter-cache-0.0.1 lib/counter/cache/counters/buffer_counter.rb