Skip to content

Instantly share code, notes, and snippets.

@ehq
Created December 22, 2011 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ehq/1511166 to your computer and use it in GitHub Desktop.
Save ehq/1511166 to your computer and use it in GitHub Desktop.
def bid_ids
key[:bids].zrange(0, -1)
end
def bids
bid_ids.map { |id| Bid[id] }
end
def add_bid(bid)
key[:bids].zadd(bid.value, bid.id)
end
def remove_bid_id(id)
key[:bids].zrem id
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment