Method: Sohm::Model#counters
- Defined in:
- lib/sohm.rb
#counters ⇒ Object
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 |
# File 'lib/sohm.rb', line 1024 def counters hash = {} self.class.counters.each do |name| hash[name] = 0 end return hash if new? redis.call("HGETALL", key[:_counters]).each_slice(2).each do |pair| hash[pair[0].to_sym] = pair[1].to_i end hash end |