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.
6 7 8 |
# File 'lib/xlsxtream/io/directory.rb', line 6 def initialize(path) @path = Pathname(path) end |
Instance Method Details
#<<(data) ⇒ Object
10 11 12 |
# File 'lib/xlsxtream/io/directory.rb', line 10 def <<(data) @file << data end |
#add_file(path) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/xlsxtream/io/directory.rb', line 14 def add_file(path) close file_path = @path + path file_path.parent.mkpath @file = file_path.open("wb") end |
#close ⇒ Object
21 22 23 |
# File 'lib/xlsxtream/io/directory.rb', line 21 def close @file.close if @file.respond_to? :close end |