Sha256: 30e6c755784a8ef5e444521bd21c4541c804212d650f28b28d5837df96277d3b

Contents?: true

Size: 515 Bytes

Versions: 4

Compression:

Stored size: 515 Bytes

Contents

module Basket
  class QueueCollection
    def initialize(backend = Basket.config.backend)
      @backend = backend.new
    end

    def push(queue, data)
      @backend.push(queue, data)
      length(queue)
    end

    def length(queue)
      @backend.length(queue)
    end

    def read(queue)
      @backend.read(queue)
    end

    def clear(queue)
      @backend.clear(queue)
    end

    def data
      @backend.data
    end

    def reset_backend
      @backend = Basket.config.backend.new
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
basket-0.0.6 lib/basket/queue_collection.rb
basket-0.0.5 lib/basket/queue_collection.rb
basket-0.0.4 lib/basket/queue_collection.rb
basket-0.0.3 lib/basket/queue_collection.rb