Class: Remi::Extractor::LocalFile
- Inherits:
-
Object
- Object
- Remi::Extractor::LocalFile
- Defined in:
- lib/remi/extractor/sftp_file.rb
Instance Method Summary collapse
- #extract ⇒ Object
-
#initialize(path:, folder: nil) ⇒ LocalFile
constructor
A new instance of LocalFile.
Constructor Details
#initialize(path:, folder: nil) ⇒ LocalFile
Returns a new instance of LocalFile.
5 6 7 8 |
# File 'lib/remi/extractor/sftp_file.rb', line 5 def initialize(path:, folder: nil) @path = path @folder = folder end |
Instance Method Details
#extract ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/remi/extractor/sftp_file.rb', line 10 def extract if @folder Dir.entries(@folder).map do |entry| next unless entry.match(@path) File.join(@folder,entry) end.compact else @path end end |