Module: Tarantool::Model::Counters

Included in:
Tarantool::Model
Defined in:
tarantool-model/lib/tarantool/model/counters.rb

Overview

Atomic '+'/'-' on the server, without validations or callbacks. Only the counter is taken from the response, so other unsaved changes of the record survive.

Instance Method Summary collapse

Instance Method Details

#decrement!(attribute, by = 1) ⇒ Object



12
13
14
# File 'tarantool-model/lib/tarantool/model/counters.rb', line 12

def decrement!(attribute, by = 1)
  change_counter('-', attribute, by)
end

#increment!(attribute, by = 1) ⇒ Object



8
9
10
# File 'tarantool-model/lib/tarantool/model/counters.rb', line 8

def increment!(attribute, by = 1)
  change_counter('+', attribute, by)
end