Class: Xlsxtream::IO::Stream
- Inherits:
-
Object
- Object
- Xlsxtream::IO::Stream
- Defined in:
- lib/xlsxtream/io/stream.rb
Instance Method Summary collapse
- #<<(data) ⇒ Object
- #add_file(path) ⇒ Object
- #close ⇒ Object
-
#initialize(stream) ⇒ Stream
constructor
A new instance of Stream.
Constructor Details
#initialize(stream) ⇒ Stream
Returns a new instance of Stream.
5 6 7 8 |
# File 'lib/xlsxtream/io/stream.rb', line 5 def initialize(stream) @stream = stream @path = nil end |
Instance Method Details
#<<(data) ⇒ Object
10 11 12 |
# File 'lib/xlsxtream/io/stream.rb', line 10 def <<(data) @stream << data end |
#add_file(path) ⇒ Object
14 15 16 17 18 |
# File 'lib/xlsxtream/io/stream.rb', line 14 def add_file(path) close @path = path @stream << "#@path\n" end |
#close ⇒ Object
20 21 22 |
# File 'lib/xlsxtream/io/stream.rb', line 20 def close @stream << "\n" if @path end |