Class: Dnnbundler::FileEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/dnnbundler/fileEntry.rb

Instance Method Summary collapse

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

#bufferObject

StringIO buffer with nested zip file



31
32
33
# File 'lib/dnnbundler/fileEntry.rb', line 31

def buffer
    @buffer
end

#flattenObject

True if existing directory structure shouldn’t be preserved’



26
27
28
# File 'lib/dnnbundler/fileEntry.rb', line 26

def flatten
    @flatten
end

#nameObject

Entry name, used as a real path in file system



21
22
23
# File 'lib/dnnbundler/fileEntry.rb', line 21

def name
    @name
end

#pathObject

Path of entry in a zip archive



36
37
38
# File 'lib/dnnbundler/fileEntry.rb', line 36

def path
    @path
end

#typeObject

Entry type: ZIP or FILE



16
17
18
# File 'lib/dnnbundler/fileEntry.rb', line 16

def type
    @type
end