Class: Omnizip::ArchiveHandlers::ZipHandler::FileProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/omnizip/archive_handlers/zip_handler.rb

Overview

Translates the generic add(name, source_path) and add_data(name, data) interface. Zip::File#add_data is private, so in-memory content goes through the public block form add(name) { data }.

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ FileProxy

Returns a new instance of FileProxy.



80
81
82
# File 'lib/omnizip/archive_handlers/zip_handler.rb', line 80

def initialize(file)
  @file = file
end

Instance Method Details

#add(name, source_path = nil) ⇒ Object



84
85
86
# File 'lib/omnizip/archive_handlers/zip_handler.rb', line 84

def add(name, source_path = nil)
  @file.add(name, source_path)
end

#add_data(name, data) ⇒ Object



88
89
90
# File 'lib/omnizip/archive_handlers/zip_handler.rb', line 88

def add_data(name, data)
  @file.add(name) { data }
end