Class: Zip::FileSystem::ZipFsDirIterator
- Inherits:
-
Object
- Object
- Zip::FileSystem::ZipFsDirIterator
- Includes:
- Enumerable
- Defined in:
- lib/zip/filesystem.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.
513 514 515 516 |
# File 'lib/zip/filesystem.rb', line 513 def initialize(arrayOfFileNames) @fileNames = arrayOfFileNames @index = 0 end |
Instance Method Details
#close ⇒ Object
518 519 520 |
# File 'lib/zip/filesystem.rb', line 518 def close @fileNames = nil end |
#each(&aProc) ⇒ Object
522 523 524 525 |
# File 'lib/zip/filesystem.rb', line 522 def each(&aProc) raise IOError, 'closed directory' if @fileNames.nil? @fileNames.each(&aProc) end |
#read ⇒ Object
527 528 529 530 |
# File 'lib/zip/filesystem.rb', line 527 def read raise IOError, 'closed directory' if @fileNames.nil? @fileNames[(@index += 1) - 1] end |
#rewind ⇒ Object
532 533 534 535 |
# File 'lib/zip/filesystem.rb', line 532 def rewind raise IOError, 'closed directory' if @fileNames.nil? @index = 0 end |
#seek(anIntegerPosition) ⇒ Object
537 538 539 540 |
# File 'lib/zip/filesystem.rb', line 537 def seek(anIntegerPosition) raise IOError, 'closed directory' if @fileNames.nil? @index = anIntegerPosition end |
#tell ⇒ Object
542 543 544 545 |
# File 'lib/zip/filesystem.rb', line 542 def tell raise IOError, 'closed directory' if @fileNames.nil? @index end |