Sha256: 5c0e80becff5c50be1273a3cf6a02a0931d5f32cb1ff62fb152ec7ea27c95748

Contents?: true

Size: 313 Bytes

Versions: 2

Compression:

Stored size: 313 Bytes

Contents

module Vedeu
  module Queue
    extend self

    def dequeue
      store.pop
    end

    def enqueue(result)
      store.unshift(result)

      self
    end

    def enqueued?
      store.size > 0
    end

    def reset
      store.clear
    end

    private

    def store
      @store ||= []
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.1.2 lib/vedeu/support/queue.rb
vedeu-0.1.1 lib/vedeu/support/queue.rb