Class: Xlsxtream::IO::Directory
- Inherits:
-
Object
- Object
- Xlsxtream::IO::Directory
- Defined in:
- lib/xlsxtream/io/directory.rb
Instance Method Summary collapse
- #<<(data) ⇒ Object
- #add_file(path) ⇒ Object
- #close ⇒ Object
-
#initialize(path) ⇒ Directory
constructor
A new instance of Directory.
Constructor Details
#initialize(path) ⇒ Directory
Returns a new instance of Directory.
7 8 9 10 |
# File 'lib/xlsxtream/io/directory.rb', line 7 def initialize(path) @path = Pathname(path) @file = nil end |
Instance Method Details
#<<(data) ⇒ Object
12 13 14 |
# File 'lib/xlsxtream/io/directory.rb', line 12 def <<(data) @file << data end |
#add_file(path) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/xlsxtream/io/directory.rb', line 16 def add_file(path) close file_path = @path + path file_path.parent.mkpath @file = file_path.open("wb") end |
#close ⇒ Object
23 24 25 |
# File 'lib/xlsxtream/io/directory.rb', line 23 def close @file.close if @file end |