Class: JSONQueue

Inherits:
Queue
  • Object
show all
Defined in:
lib/reimporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ JSONQueue

Returns a new instance of JSONQueue.



2
3
4
5
6
# File 'lib/reimporter.rb', line 2

def initialize(opts)
  super()
  @file = opts[:file]
  @counter = opts[:counter]
end

Instance Method Details

#add_to_queueObject



8
9
10
11
12
13
# File 'lib/reimporter.rb', line 8

def add_to_queue
  json = JSON.parse(File.read(@file))
  json.each do |line|
    self << line
  end
end