Class: MockSFTP::SFTPDir

Inherits:
Object
  • Object
show all
Defined in:
lib/mock_sftp.rb

Instance Method Summary collapse

Constructor Details

#initialize(dir) ⇒ SFTPDir

Returns a new instance of SFTPDir.



11
# File 'lib/mock_sftp.rb', line 11

def initialize(dir) ; @dir = dir ; end

Instance Method Details

#[](base, pattern) ⇒ Object



13
14
15
16
17
# File 'lib/mock_sftp.rb', line 13

def [](base, pattern)
  Dir[File.join(@dir, base, pattern)].map do |p|
    SFTPEntry.new(:name => File.basename(p))
  end
end