Class: ZipDir::Dir::Proxy
- Inherits:
-
Object
- Object
- ZipDir::Dir::Proxy
- Defined in:
- lib/zip_dir/dir.rb
Instance Method Summary collapse
- #add_path(source_path, options = {}) ⇒ Object (also: #<<)
-
#initialize(copy_path) ⇒ Proxy
constructor
A new instance of Proxy.
Constructor Details
#initialize(copy_path) ⇒ Proxy
Returns a new instance of Proxy.
33 34 35 |
# File 'lib/zip_dir/dir.rb', line 33 def initialize(copy_path) @copy_path = copy_path end |
Instance Method Details
#add_path(source_path, options = {}) ⇒ Object Also known as: <<
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/zip_dir/dir.rb', line 37 def add_path(source_path, ={}) = .inject({}){|hash,(k,v)| hash[k.to_sym] = v; hash} if File.directory?(source_path) add_directory source_path, elsif File.file?(source_path) add_simple_path source_path, else raise "Attempting to add non-existent path: #{source_path}" end end |