Class: Dnnbundler::FileEntry
- Inherits:
-
Object
- Object
- Dnnbundler::FileEntry
- Defined in:
- lib/dnnbundler/fileEntry.rb
Instance Method Summary collapse
-
#add_buffer(buffer) ⇒ Object
Saves
StringIObuffer into object, intended to store nested zip files in memory. -
#buffer ⇒ Object
StringIObuffer with nested zip file. -
#flatten ⇒ Object
True if existing directory structure shouldn’t be preserved’.
-
#initialize(file_name, entry_type = FileEntryType::FILE, flatten_structure = false, file_path = nil) ⇒ FileEntry
constructor
A new instance of FileEntry.
-
#name ⇒ Object
Entry name, used as a real path in file system.
-
#path ⇒ Object
Path of entry in a zip archive.
-
#type ⇒ Object
Entry type: ZIP or FILE.
Constructor Details
#initialize(file_name, entry_type = FileEntryType::FILE, flatten_structure = false, file_path = nil) ⇒ FileEntry
Returns a new instance of FileEntry.
3 4 5 6 7 8 |
# File 'lib/dnnbundler/fileEntry.rb', line 3 def initialize(file_name, entry_type = FileEntryType::FILE, flatten_structure = false, file_path = nil) @type = entry_type @name = file_name @path = file_path @flatten = flatten_structure end |
Instance Method Details
#add_buffer(buffer) ⇒ Object
Saves StringIO buffer into object, intended to store nested zip files in memory
11 12 13 |
# File 'lib/dnnbundler/fileEntry.rb', line 11 def add_buffer(buffer) @buffer = buffer end |
#buffer ⇒ Object
StringIO buffer with nested zip file
31 32 33 |
# File 'lib/dnnbundler/fileEntry.rb', line 31 def buffer @buffer end |
#flatten ⇒ Object
True if existing directory structure shouldn’t be preserved’
26 27 28 |
# File 'lib/dnnbundler/fileEntry.rb', line 26 def flatten @flatten end |
#name ⇒ Object
Entry name, used as a real path in file system
21 22 23 |
# File 'lib/dnnbundler/fileEntry.rb', line 21 def name @name end |
#path ⇒ Object
Path of entry in a zip archive
36 37 38 |
# File 'lib/dnnbundler/fileEntry.rb', line 36 def path @path end |
#type ⇒ Object
Entry type: ZIP or FILE
16 17 18 |
# File 'lib/dnnbundler/fileEntry.rb', line 16 def type @type end |