Module: Redis::Objects::Counters::InstanceMethods

Defined in:
lib/redis/objects/counters.rb

Overview

Instance methods that appear in your class when you include Redis::Objects.

Instance Method Summary collapse

Instance Method Details

#decrement(name, by = 1) ⇒ Object

Decrement a counter. It is more efficient to use increment_ directly. This is mainly just for completeness to override ActiveRecord.



125
126
127
# File 'lib/redis/objects/counters.rb', line 125

def decrement(name, by=1)
  send(name).decrement(by)
end

#increment(name, by = 1) ⇒ Object

Increment a counter. It is more efficient to use increment_ directly. This is mainly just for completeness to override ActiveRecord.



118
119
120
# File 'lib/redis/objects/counters.rb', line 118

def increment(name, by=1)
  send(name).increment(by)
end