Sha256: 9307a64e2061fa72fa777858f75d2475d95e0dd5ece31cabb2f68adfa95d9a66

Contents?: true

Size: 401 Bytes

Versions: 1

Compression:

Stored size: 401 Bytes

Contents

module Vedeu
  module Queue
    extend self

    def dequeue
      store.pop
    end

    def enqueue(result)
      store.unshift(result)
      store
    end

    def enqueued?
      store.size > 0
    end

    def size
      store.size
    end

    def clear
      store.clear
    end

    def view
      store.inspect
    end

    private

    def store
      @store ||= Array.new
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.0.18 lib/vedeu/support/queue.rb