Class: Minuteman::Counter

Inherits:
Model
  • Object
show all
Defined in:
lib/minuteman/counter.rb

Direct Known Subclasses

User

Defined Under Namespace

Classes: User

Instance Method Summary collapse

Methods inherited from Model

create, find, find_or_create, #key

Instance Method Details

#countObject



17
18
19
# File 'lib/minuteman/counter.rb', line 17

def count
  Minuteman.config.redis.call("GET", key).to_i
end

#incrObject



13
14
15
# File 'lib/minuteman/counter.rb', line 13

def incr
  Minuteman.config.redis.call("INCR", key)
end