Class: Zip::ZipFileSystem::ZipFsDirIterator
- Inherits:
-
Object
- Object
- Zip::ZipFileSystem::ZipFsDirIterator
- Includes:
- Enumerable
- Defined in:
- lib/zip/zipfilesystem.rb
Overview
:nodoc:all
Instance Method Summary collapse
- #close ⇒ Object
- #each(&aProc) ⇒ Object
-
#initialize(arrayOfFileNames) ⇒ ZipFsDirIterator
constructor
A new instance of ZipFsDirIterator.
- #read ⇒ Object
- #rewind ⇒ Object
- #seek(anIntegerPosition) ⇒ Object
- #tell ⇒ Object
Constructor Details
#initialize(arrayOfFileNames) ⇒ ZipFsDirIterator
Returns a new instance of ZipFsDirIterator.
511 512 513 514 |
# File 'lib/zip/zipfilesystem.rb', line 511 def initialize(arrayOfFileNames) @fileNames = arrayOfFileNames @index = 0 end |
Instance Method Details
#close ⇒ Object
516 517 518 |
# File 'lib/zip/zipfilesystem.rb', line 516 def close @fileNames = nil end |
#each(&aProc) ⇒ Object
520 521 522 523 |
# File 'lib/zip/zipfilesystem.rb', line 520 def each(&aProc) raise IOError, "closed directory" if @fileNames == nil @fileNames.each(&aProc) end |
#read ⇒ Object
525 526 527 528 |
# File 'lib/zip/zipfilesystem.rb', line 525 def read raise IOError, "closed directory" if @fileNames == nil @fileNames[(@index+=1)-1] end |
#rewind ⇒ Object
530 531 532 533 |
# File 'lib/zip/zipfilesystem.rb', line 530 def rewind raise IOError, "closed directory" if @fileNames == nil @index = 0 end |
#seek(anIntegerPosition) ⇒ Object
535 536 537 538 |
# File 'lib/zip/zipfilesystem.rb', line 535 def seek(anIntegerPosition) raise IOError, "closed directory" if @fileNames == nil @index = anIntegerPosition end |
#tell ⇒ Object
540 541 542 543 |
# File 'lib/zip/zipfilesystem.rb', line 540 def tell raise IOError, "closed directory" if @fileNames == nil @index end |