blob: 1d2af693f74644b95ec04c63b75149f4ace19d7f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
## Description
You could serialize the package into a stream instead of writing to a file directly.
## Code
```ruby
require 'axlsx'
p = Axlsx::Package.new
wb = p.workbook
wb.add_worksheet(name: 'Basic Worksheet') do |sheet|
sheet.add_row ['First', 'Second', 'Third']
sheet.add_row [1, 2, 3]
end
stream = p.to_stream
File.open('stream_example.xlsx', 'wb') { |f| f.write(stream.read) }
```
## Output
No difference should be visible
|