Skip to content

Instantly share code, notes, and snippets.

@ctrochalakis
Forked from soveran/sample.rb
Created June 14, 2010 19:58
Show Gist options
  • Save ctrochalakis/438219 to your computer and use it in GitHub Desktop.
Save ctrochalakis/438219 to your computer and use it in GitHub Desktop.
require "redis"
require "nest"
redis = Redis.new
users = Nest.new(:users, redis)
posts = Nest.new(:posts, redis)
user = users[users.incr]
user.hmset(:name, "Albert")
post = posts[posts.incr]
redis.multi do
post.hmset(:title, "foo", :content, "bar", :author, user)
user[:posts].sadd(post)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment