Class: QueueLite::Enqueue

Inherits:
Module
  • Object
show all
Defined in:
lib/queue_lite/enqueue.rb

Instance Method Summary collapse

Constructor Details

#initialize(queue) ⇒ Enqueue

Returns a new instance of Enqueue.



7
8
9
10
11
12
# File 'lib/queue_lite/enqueue.rb', line 7

def initialize(queue)
  define_method :enqueue do |*args|
    queue.put(JSON.generate([self.class.to_s, *args]))
    true
  end
end