redict/client-libraries/ruby/examples/incr-decr.rb

19 lines
220 B
Ruby
Raw Normal View History

2009-03-22 05:30:00 -04:00
require 'rubygems'
require 'redis'
r = Redis.new
puts
p 'incr'
r.delete 'counter'
p r.incr('counter')
p r.incr('counter')
p r.incr('counter')
puts
p 'decr'
p r.decr('counter')
p r.decr('counter')
p r.decr('counter')