Created
December 22, 2011 17:47
-
-
Save ehq/1511166 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
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