Class: LocalFileAdapter
- Inherits:
-
Object
- Object
- LocalFileAdapter
- Defined in:
- lib/utils/adapters.rb
Instance Method Summary collapse
- #download ⇒ Object
-
#initialize(file_path) ⇒ LocalFileAdapter
constructor
This adapter will wrap a local file path and provide a download method that yields the file’s contents.
Constructor Details
#initialize(file_path) ⇒ LocalFileAdapter
This adapter will wrap a local file path and provide a download method that yields the file’s contents
3 4 5 |
# File 'lib/utils/adapters.rb', line 3 def initialize(file_path) @file_path = file_path end |
Instance Method Details
#download ⇒ Object
7 8 9 10 11 |
# File 'lib/utils/adapters.rb', line 7 def download File.open(@file_path, 'rb') do |file| yield file.read end end |