benlund/roc — Issue #1: Integers not saved in redis
Author: zoomix
Created: 2011-12-20 09:13:30+00:00
State: open

When initiating an integer, no keys are created in redis. The same works for hashes and such. An example here. The expected outcome is to see integers increase with 5 each time the program is run. Same as the hash gets appended with each run.

require 'redis-roc'
require 'redis'

Store = ROC::Store::RedisStore.new(Redis.new)

integer = Store.init_integer("integer")
puts "Integer #{integer.value}"
integer = 0 if integer.value.nil?
integer += 5

stuff = Store.init_hash('stuff')
puts "stuff: #{stuff.to_h}"
stuff[rand(100).to_s] = 'something'