Class: JSONQueue
- Inherits:
-
Queue
- Object
- Queue
- JSONQueue
- Defined in:
- lib/reimporter.rb
Instance Method Summary collapse
- #add_to_queue ⇒ Object
-
#initialize(opts) ⇒ JSONQueue
constructor
A new instance of JSONQueue.
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_queue ⇒ Object
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 |