Sha256: c4001d291e900d2b023338f9d667ace42bbc77788194bfa32235ed297d37b27b

Contents?: true

Size: 312 Bytes

Versions: 5

Compression:

Stored size: 312 Bytes

Contents

module Riak
  module Crdt
    class BatchCounter
      attr_reader :accumulator
      
      def initialize
        @accumulator = 0
      end
      
      def increment(amount=1)
        @accumulator += amount
      end
      
      def decrement(amount=1)
        increment -amount
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
riak-client-2.2.0.pre1 lib/riak/crdt/batch_counter.rb
riak-client-2.1.0 lib/riak/crdt/batch_counter.rb
riak-client-2.0.0 lib/riak/crdt/batch_counter.rb
riak-client-2.0.0.rc2 lib/riak/crdt/batch_counter.rb
riak-client-2.0.0.rc1 lib/riak/crdt/batch_counter.rb