Class: EXEL::Providers::LocalFileProvider
- Inherits:
-
Object
- Object
- EXEL::Providers::LocalFileProvider
- Defined in:
- lib/exel/providers/local_file_provider.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.remote?(uri) ⇒ Boolean
13 14 15 |
# File 'lib/exel/providers/local_file_provider.rb', line 13 def self.remote?(uri) uri =~ %r{file://} end |
Instance Method Details
#download(uri) ⇒ Object
8 9 10 11 |
# File 'lib/exel/providers/local_file_provider.rb', line 8 def download(uri) fail 'URI must begin with "file://"' unless uri.start_with? 'file://' File.open(uri.split('file://').last) end |
#upload(file) ⇒ Object
4 5 6 |
# File 'lib/exel/providers/local_file_provider.rb', line 4 def upload(file) "file://#{file.path}" end |