lib/q3.rb in q3-0.0.0 vs lib/q3.rb in q3-0.0.1

- old
+ new

@@ -51,18 +51,18 @@ timestamp = now hash = CREATE_QUEUE.inject({'CreateTimestamp' => timestamp, 'LastModifiedTimestamp' => timestamp}) do |hash, attribute| hash[attribute] = attributes[attribute] || DEFAULTS[attribute] hash end - redis.rpush("Queues", params[:QueueName]) + redis.sadd("Queues", params[:QueueName]) redis.hmset("Queues:#{params[:QueueName]}", *hash.to_a) return_xml {|xml| xml.QueueUrl queue_url("#{params[:QueueName]}") } end action('ListQueues') do return_xml do |xml| - redis.lrange('Queues', 0, -1).each {|queue_name| xml.QueueUrl queue_url(queue_name) } + redis.smembers('Queues').each {|queue_name| xml.QueueUrl queue_url(queue_name) } end end action('GetQueueUrl') do validate_queue_existence @@ -95,10 +95,10 @@ end action('DeleteQueue', '/*/:QueueName') do validate_queue_existence redis.keys("Queues:#{params[:QueueName]}*").each {|key| redis.del(key) } - redis.lrem("Queues", 0, params[:QueueName]) + redis.srem("Queues", params[:QueueName]) return_xml {} end action('SendMessage', '/*/:QueueName') do validate_queue_existence