Class: CIFS::DirReader

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

Instance Method Summary (collapse)

Constructor Details

- (DirReader) initialize(smbfile)

smbfile

a jcifs.smb.SmbFile object



278
279
280
281
# File 'lib/jcifs.rb', line 278

def initialize(smbfile)
    @smbfile = smbfile
    @files = @smbfile.listFiles
end

Instance Method Details

- (Object) each

yields a sorted list of SmbFile objects



284
285
286
287
288
# File 'lib/jcifs.rb', line 284

def each
    @files \
        .sort{ |a,b| a.getName <=> b.getName } \
        .each{ |file| yield file }
end