Module: Xporter::Exporter::Streaming

Extended by:
ActiveSupport::Concern
Included in:
Xporter::Exporter
Defined in:
lib/xporter/exporter/streaming.rb

Instance Method Summary collapse

Instance Method Details

#stream(collection, stream) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/xporter/exporter/streaming.rb', line 12

def stream(collection, stream)
  stream.write CSV.generate_line(headers)

  @collection = collection

  content.each do |row|
    stream.write CSV.generate_line(row)
  end
end