Created
February 26, 2011 16:24
-
-
Save andrewschaaf/845361 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# client = ... | |
class User | |
constructor: (call_when_created) -> | |
m = client.multi() | |
m.incr "user_id" | |
m.get "user_id", (e, r) -> | |
@id = parseInt r, 10 | |
call_when_created this | |
m.exec() | |
new User (user) -> | |
console.log user.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment